From d35c2a99cf7ebcc440ed39458944c004068ff958 Mon Sep 17 00:00:00 2001 From: BrentVL-1952840 <70229620+Brentdevent@users.noreply.github.com> Date: Tue, 21 Feb 2023 20:49:35 +0100 Subject: [PATCH] Fix connecting to zombie dedicated servers --- src/client/component/party.cpp | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/client/component/party.cpp b/src/client/component/party.cpp index bf938631..c653be48 100644 --- a/src/client/component/party.cpp +++ b/src/client/component/party.cpp @@ -228,14 +228,22 @@ namespace party return *reinterpret_cast(address); } + bool is_mp() + { + return game::Com_SessionMode_GetMode() == game::MODE_MULTIPLAYER; + } + int should_transfer_stub(uint8_t* storage_file_info) { auto should_transfer = game::ShouldTransfer(storage_file_info); - const auto offset = storage_file_info - reinterpret_cast(0x14343CDF0_g); const auto index = offset / 120; - if (index >= 12 && index <= 15 && is_connecting_to_dedi && get_connected_server() == connect_host) + // Choose between multiplayer or zombies indices + const auto stats_index = is_mp() ? 12 : 15; + const auto loadout_index = is_mp() ? 17 : 20; + + if (index >= stats_index && index <= loadout_index && is_connecting_to_dedi && get_connected_server() == connect_host) { should_transfer = !should_transfer; }