space + sv_motd empty check gone

This commit is contained in:
m 2021-05-19 14:19:14 -05:00
parent b7b5520ab2
commit 2b7988d4ba
2 changed files with 4 additions and 6 deletions

View File

@ -125,7 +125,7 @@ namespace exception
recovery_data.last_recovery = std::chrono::high_resolution_clock::now(); recovery_data.last_recovery = std::chrono::high_resolution_clock::now();
++recovery_data.recovery_counts; ++recovery_data.recovery_counts;
party::clear_sv_motd(); // clear sv_motd on error if it exists party::clear_sv_motd(); // clear sv_motd on error
game::Com_Error(game::ERR_DROP, "Fatal error (0x%08X) at 0x%p.\nA minidump has been written.\n\n" game::Com_Error(game::ERR_DROP, "Fatal error (0x%08X) at 0x%p.\nA minidump has been written.\n\n"
"S1x has tried to recover your game, but it might not run stable anymore.\n\n" "S1x has tried to recover your game, but it might not run stable anymore.\n\n"

View File

@ -138,6 +138,7 @@ namespace party
} }
utils::hook::detour cldisconnect_hook; utils::hook::detour cldisconnect_hook;
void cldisconnect_stub(int a1) void cldisconnect_stub(int a1)
{ {
clear_sv_motd(); clear_sv_motd();
@ -153,11 +154,8 @@ namespace party
} }
void clear_sv_motd() void clear_sv_motd()
{
if (!party::sv_motd.empty())
{ {
party::sv_motd.clear(); party::sv_motd.clear();
}
return; return;
} }
@ -301,7 +299,7 @@ namespace party
// hook disconnect command function // hook disconnect command function
utils::hook::jump(0x14020A010, disconnect_stub); utils::hook::jump(0x14020A010, disconnect_stub);
// detour CL_Disconnect to clear motd if it exists // detour CL_Disconnect to clear motd
cldisconnect_hook.create(0x140209EC0, cldisconnect_stub); cldisconnect_hook.create(0x140209EC0, cldisconnect_stub);
if (game::environment::is_mp()) if (game::environment::is_mp())