Skip to content

Commit

Permalink
Merge branch 'mr-144'
Browse files Browse the repository at this point in the history
tweak(gta-net-five): fix GTA_FIVE ifdef's (mr-144):
 - d03d2be tweak(gta-net-five): fix GTA_FIVE ifdef's
  • Loading branch information
thorium-cfx committed Nov 6, 2023
2 parents 47f8999 + d03d2be commit 7b59ac0
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions code/components/gta-net-five/src/CloneExperiments.cpp
Expand Up @@ -782,7 +782,8 @@ static CNetGamePlayer* AllocateNetPlayer(void* mgr)

// fix: some Events expect the CPlayerInfo to be non-null in the CNetGamePlayer (It is not set in the constructor)
static void Player31_ApplyPlayerInfo(CNetGamePlayer* player)
{
{
#ifdef GTA_FIVE
static void* infoMem = nullptr;
if (!infoMem)
{
Expand All @@ -794,11 +795,14 @@ static void Player31_ApplyPlayerInfo(CNetGamePlayer* player)
{
*(CPlayerInfo_Five**)((uint64_t)player + g_CNetPlayerOffset_PlayerInfo) = (CPlayerInfo_Five*)infoMem;
}
#endif
}
// Clear the playerInfo after events
static void Player31_ClearPlayerInfo(CNetGamePlayer* player)
{
*(CPlayerInfo_Five**)((uint64_t)player + g_CNetPlayerOffset_PlayerInfo) = nullptr;
{
#ifdef GTA_FIVE
*(CPlayerInfo_Five**)((uint64_t)player + g_CNetPlayerOffset_PlayerInfo) = nullptr;
#endif
}

#include <minhook.h>
Expand Down

0 comments on commit 7b59ac0

Please sign in to comment.