Automatically stop cinematic when joining zombies matches

Fixes #97
This commit is contained in:
Maurice Heumann 2023-01-08 16:14:06 +01:00
parent 5f4f498a1e
commit e7de6af00a
2 changed files with 31 additions and 2 deletions

View File

@ -31,10 +31,34 @@ namespace party
return server_queries;
}
void stop_zombies_intro_when_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());
stop_zombies_intro_when_needed();
}
void launch_mode(const game::eModes mode)

View File

@ -43,13 +43,16 @@ namespace game
WEAK symbol<uint8_t(msg_t* msg)> MSG_ReadByte{0x142155EB0, 0x14050D1B0};
// NET
WEAK symbol<bool(netsrc_t sock, int length, const void* data, const netadr_t* to)> NET_SendPacket{0x142332F70, 0x140596E40};
WEAK symbol<bool(netsrc_t sock, int length, const void* data, const netadr_t* to)> NET_SendPacket{
0x142332F70, 0x140596E40
};
WEAK symbol<bool(char const*, netadr_t*)> NET_StringToAdr{0x1421731E0, 0x140515110};
// Sys
WEAK symbol<int()> Sys_Milliseconds{0x142333430};
WEAK symbol<void()> Sys_ShowConsole{0x142333F80, 0x140597E40 };
WEAK symbol<void()> Sys_ShowConsole{0x142333F80, 0x140597E40};
WEAK symbol<TLSData*()> Sys_GetTLS{0x142184210, 0x140525EB0};
WEAK symbol<TLSData*()> Sys_IsDatabaseReady{0x1421844C0};
// Dvar
WEAK symbol<const dvar_t*(const char* dvarName)> Dvar_FindVar{0x1422BD730, 0x140575540};
@ -61,6 +64,8 @@ namespace game
0x1422C7F60
};
WEAK symbol<void(uint64_t id, bool cancelAll)> Cinematic_StopPlayback{0x1412BEA70};
// Rendering
WEAK symbol<void(const char*, int, const void*, float, float, float, float, float, const float*, int)>
R_AddCmdDrawText{