Fix crash on map rotation

This commit is contained in:
Federico Cecchetto 2022-05-22 00:38:15 +02:00
parent 97846858e8
commit df3fdb7991
2 changed files with 5 additions and 5 deletions

View File

@ -316,9 +316,6 @@ namespace dedicated
// Workaround for server spamming 'exec default_xboxlive.cfg' when not running
ui_set_active_menu_hook.create(0x1E4D80_b, ui_set_active_menu_stub);
// Dont free server client memory on asset loading
utils::hook::nop(0x132474_b, 5);
// initialize the game after onlinedataflags is 32 (workaround)
scheduler::schedule([=]()
{

View File

@ -124,10 +124,10 @@ namespace patches
command::params_sv params{};
const auto menu_id = atoi(params.get(1));
const auto client = svs_clients[ent->s.entityNum];
const auto client = &svs_clients[ent->s.entityNum];
// 22 => "end_game"
if (menu_id == 22 && client.header.remoteAddress.type != game::NA_LOOPBACK)
if (menu_id == 22 && client->header.remoteAddress.type != game::NA_LOOPBACK)
{
return;
}
@ -308,6 +308,9 @@ namespace patches
// Change default hostname and make it replicated
dvars::override::register_string("sv_hostname", "^2H1-Mod^7 Default Server", game::DVAR_FLAG_REPLICATED);
// Dont free server/client memory on asset loading (fixes crashing on map rotation)
utils::hook::nop(0x132474_b, 5);
}
};
}