Fix zombie intro skipping during map rotation
This commit is contained in:
parent
7e22eb87b1
commit
6aadfd04c7
@ -12,6 +12,37 @@ namespace client_patches
|
||||
{
|
||||
namespace
|
||||
{
|
||||
utils::hook::detour preload_map_hook;
|
||||
|
||||
void stop_zombies_intro_if_needed()
|
||||
{
|
||||
if (game::Com_SessionMode_GetMode() != game::MODE_ZOMBIES)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
scheduler::once([]
|
||||
{
|
||||
scheduler::schedule([]
|
||||
{
|
||||
if (!game::Sys_IsDatabaseReady())
|
||||
{
|
||||
return scheduler::cond_continue;
|
||||
}
|
||||
|
||||
game::Cinematic_StopPlayback(0, true);
|
||||
return scheduler::cond_end;
|
||||
}, scheduler::main);
|
||||
}, scheduler::main, 15s);
|
||||
}
|
||||
|
||||
void preload_map_stub(int localClientNum, const char* mapname, const char* gametype)
|
||||
{
|
||||
stop_zombies_intro_if_needed();
|
||||
|
||||
preload_map_hook.invoke(localClientNum, mapname, gametype);
|
||||
}
|
||||
|
||||
void reduce_process_affinity()
|
||||
{
|
||||
const DWORD_PTR affinity = (1ULL << (std::min(std::thread::hardware_concurrency(), 4U))) - 1;
|
||||
@ -49,6 +80,8 @@ namespace client_patches
|
||||
|
||||
// Kill microphones for now
|
||||
utils::hook::set(0x15AAEB254_g, mixer_open_stub);
|
||||
|
||||
preload_map_hook.create(0x14135A1E0_g, preload_map_stub);
|
||||
}
|
||||
};
|
||||
}
|
||||
|
@ -34,34 +34,10 @@ namespace party
|
||||
return server_queries;
|
||||
}
|
||||
|
||||
void stop_zombies_intro_if_needed()
|
||||
{
|
||||
if (game::Com_SessionMode_GetMode() != game::MODE_ZOMBIES)
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
scheduler::once([]
|
||||
{
|
||||
scheduler::schedule([]
|
||||
{
|
||||
if (!game::Sys_IsDatabaseReady())
|
||||
{
|
||||
return scheduler::cond_continue;
|
||||
}
|
||||
|
||||
game::Cinematic_StopPlayback(0, true);
|
||||
return scheduler::cond_end;
|
||||
}, scheduler::main);
|
||||
}, scheduler::main, 15s);
|
||||
}
|
||||
|
||||
void connect_to_lobby(const game::netadr_t& addr, const std::string& mapname, const std::string& gamemode)
|
||||
{
|
||||
game::XSESSION_INFO info{};
|
||||
game::CL_ConnectFromLobby(0, &info, &addr, 1, 0, mapname.data(), gamemode.data(), nullptr);
|
||||
|
||||
stop_zombies_intro_if_needed();
|
||||
}
|
||||
|
||||
void launch_mode(const game::eModes mode)
|
||||
|
Loading…
Reference in New Issue
Block a user