Merge pull request #435 from diamante0018/main

fix: forgot to * the array of clients
This commit is contained in:
Maurice Heumann 2023-04-04 08:36:28 +02:00 committed by GitHub
commit 0758bd3673
2 changed files with 2 additions and 13 deletions

View File

@ -70,17 +70,7 @@ namespace dedicated_patches
uint64_t sv_get_player_xuid_stub(int client_num)
{
return static_cast<uint64_t>(game::svs_clients[client_num].xuid);
}
int sv_get_guid(int client_num)
{
if (client_num < 0 || client_num >= game::Dvar_GetInt(*game::com_maxclients))
{
return 0;
}
return game::svs_clients[client_num].xuid;
return static_cast<uint64_t>((*game::svs_clients)[client_num].xuid);
}
}
@ -109,7 +99,6 @@ namespace dedicated_patches
utils::hook::jump(0x14052F0F5_g, 0x14052F139_g);
utils::hook::call(0x1402853D7_g, sv_get_player_xuid_stub); // PlayerCmd_GetXuid
utils::hook::call(0x140283303_g, sv_get_guid); // PlayerCmd_GetGuid
}
};
}

View File

@ -190,7 +190,7 @@ namespace game
WEAK symbol<char> s_dvarPool{0x157AC6220, 0x14A3CB620};
WEAK symbol<int> g_dvarCount{0x157AC61CC, 0x14A3CB5FC};
WEAK symbol<client_s> svs_clients{0x0, 0x14A178E98};
WEAK symbol<client_s*> svs_clients{0x0, 0x14A178E98};
// Dvar variables
WEAK symbol<dvar_t*> com_maxclients{0x0, 0x14948EE70};