Permalink
Browse files

Replaced calls to Xref manager with new CPool getters

  • Loading branch information...
codenulls committed Nov 13, 2018
1 parent 354d53a commit b6a3254c1987aed7329f2f4300b6203c286dc2d0
Showing with 760 additions and 650 deletions.
  1. +3 −3 Client/game_sa/CCamSA.cpp
  2. +3 −3 Client/game_sa/CCameraSA.cpp
  3. +3 −3 Client/game_sa/CEventDamageSA.cpp
  4. +4 −4 Client/game_sa/CFireSA.cpp
  5. +4 −2 Client/game_sa/CGameSA.cpp
  6. +6 −6 Client/game_sa/CPedSA.cpp
  7. +6 −6 Client/game_sa/CPhysicalSA.cpp
  8. +1 −1 Client/game_sa/CPlayerPedSA.cpp
  9. +440 −333 Client/game_sa/CPoolsSA.cpp
  10. +32 −28 Client/game_sa/CPoolsSA.h
  11. +2 −2 Client/game_sa/CProjectileInfoSA.cpp
  12. +10 −10 Client/game_sa/CVehicleSA.cpp
  13. +1 −1 Client/game_sa/CVehicleScannerSA.cpp
  14. +3 −3 Client/game_sa/CWorldSA.cpp
  15. +1 −1 Client/game_sa/TaskPhysicalResponseSA.cpp
  16. +2 −1 Client/mods/deathmatch/logic/CClientCamera.cpp
  17. +4 −2 Client/mods/deathmatch/logic/CClientExplosionManager.cpp
  18. +86 −104 Client/mods/deathmatch/logic/CClientGame.cpp
  19. +23 −17 Client/mods/deathmatch/logic/CClientPed.cpp
  20. +3 −2 Client/mods/deathmatch/logic/CClientProjectile.cpp
  21. +5 −2 Client/mods/deathmatch/logic/CClientProjectileManager.cpp
  22. +12 −30 Client/mods/deathmatch/logic/CClientVehicle.cpp
  23. +3 −1 Client/mods/deathmatch/logic/CClientVehicleManager.cpp
  24. +4 −1 Client/mods/deathmatch/logic/CClientWeapon.cpp
  25. +2 −1 Client/mods/deathmatch/logic/CGameEntityXRefManager.cpp
  26. +4 −4 Client/mods/deathmatch/logic/CStaticFunctionDefinitions.cpp
  27. +20 −20 Client/multiplayer_sa/CMultiplayerSA.cpp
  28. +9 −9 Client/multiplayer_sa/CMultiplayerSA_1.3.cpp
  29. +1 −1 Client/multiplayer_sa/CMultiplayerSA_CrashFixHacks.cpp
  30. +1 −1 Client/multiplayer_sa/CMultiplayerSA_VehicleDamage.cpp
  31. +1 −1 Client/multiplayer_sa/CRemoteDataSA.cpp
  32. +2 −2 Client/multiplayer_sa/multiplayer_keysync.cpp
  33. +22 −22 Client/multiplayer_sa/multiplayer_shotsync.cpp
  34. +2 −0 Client/sdk/game/CGame.h
  35. +35 −23 Client/sdk/game/CPools.h
@@ -22,13 +22,13 @@ CEntity* CCamSA::GetTargetEntity(void) const
switch (pInterface->nType)
{
case ENTITY_TYPE_PED:
pReturn = (CEntity*)(pPools->GetPed((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetPed((DWORD*)pInterface)->pEntity);
break;
case ENTITY_TYPE_VEHICLE:
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface)->pEntity);
break;
case ENTITY_TYPE_OBJECT:
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface)->pEntity);
break;
default:
break;
@@ -541,13 +541,13 @@ CEntity* CCameraSA::GetTargetEntity(void)
switch (pInterface->nType)
{
case ENTITY_TYPE_PED:
pReturn = (CEntity*)(pPools->GetPed((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetPed((DWORD*)pInterface)->pEntity);
break;
case ENTITY_TYPE_VEHICLE:
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface)->pEntity);
break;
case ENTITY_TYPE_OBJECT:
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface)->pEntity);
break;
default:
break;
@@ -70,13 +70,13 @@ CEntity* CEventDamageSA::GetInflictingEntity(void)
switch (pInterface->nType)
{
case ENTITY_TYPE_PED:
pReturn = pPools->GetPed((DWORD*)pInterface);
pReturn = pPools->GetPed((DWORD*)pInterface)->pEntity;
break;
case ENTITY_TYPE_VEHICLE:
pReturn = pPools->GetVehicle((DWORD*)pInterface);
pReturn = pPools->GetVehicle((DWORD*)pInterface)->pEntity;
break;
case ENTITY_TYPE_OBJECT:
pReturn = pPools->GetObject((DWORD*)pInterface);
pReturn = pPools->GetObject((DWORD*)pInterface)->pEntity;
break;
default:
break;
@@ -76,10 +76,10 @@ CEntity* CFireSA::GetCreator()
switch (createEntitySA->nType)
{
case ENTITY_TYPE_PED:
creatorEntity = pPools->GetPed((DWORD*)createEntitySA);
creatorEntity = pPools->GetPed((DWORD*)createEntitySA)->pEntity;
break;
case ENTITY_TYPE_VEHICLE:
creatorEntity = pPools->GetVehicle((DWORD*)createEntitySA);
creatorEntity = pPools->GetVehicle((DWORD*)createEntitySA)->pEntity;
break;
default:
creatorEntity = NULL;
@@ -99,10 +99,10 @@ CEntity* CFireSA::GetEntityOnFire()
switch (TargetEntitySA->nType)
{
case ENTITY_TYPE_PED:
TargetEntity = pPools->GetPed((DWORD*)TargetEntitySA);
TargetEntity = pPools->GetPed((DWORD*)TargetEntitySA)->pEntity;
break;
case ENTITY_TYPE_VEHICLE:
TargetEntity = pPools->GetVehicle((DWORD*)TargetEntitySA);
TargetEntity = pPools->GetVehicle((DWORD*)TargetEntitySA)->pEntity;
break;
default:
TargetEntity = NULL;
@@ -353,13 +353,13 @@ BOOL CGameSA::InitLocalPlayer(CClientPed* pClientPed)
DEBUG_TRACE("BOOL CGameSA::InitLocalPlayer( )");

// Added by ChrML - Looks like it isn't safe to call this more than once but mod code might do
static bool bAlreadyInited = false;
/*static bool bAlreadyInited = false;
if (bAlreadyInited)
{
return TRUE;
}
bAlreadyInited = true;

*/
CPoolsSA* pools = (CPoolsSA*)this->GetPools();
if (pools)
{
@@ -368,6 +368,7 @@ BOOL CGameSA::InitLocalPlayer(CClientPed* pClientPed)

if (pInterface)
{
pools->ResetPedPoolCount();
pools->AddPed(pClientPed, (DWORD*)pInterface);
return TRUE;
}
@@ -869,3 +870,4 @@ CPed* CGameSA::GetPedContext(void)
m_pPedContext = pGame->GetPools()->GetPedFromRef((DWORD)1);
return m_pPedContext;
}

@@ -242,7 +242,7 @@ CVehicle* CPedSA::GetVehicle()
{
CVehicleSAInterface* vehicle = (CVehicleSAInterface*)(((CPedSAInterface*)this->GetInterface())->CurrentObjective);
if (vehicle)
return ((CPoolsSA*)pGame->GetPools())->GetVehicle((DWORD*)vehicle);
return ((CPoolsSA*)pGame->GetPools())->GetVehicle((DWORD*)vehicle)->pEntity;
}
return NULL;
}
@@ -772,10 +772,10 @@ CEntity* CPedSA::GetContactEntity(void)
switch (pInterface->nType)
{
case ENTITY_TYPE_VEHICLE:
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface)->pEntity);
break;
case ENTITY_TYPE_OBJECT:
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface)->pEntity);
break;
default:
break;
@@ -800,13 +800,13 @@ CEntity* CPedSA::GetTargetedEntity(void)
switch (pInterface->nType)
{
case ENTITY_TYPE_PED:
pReturn = (CEntity*)(pPools->GetPed((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetPed((DWORD*)pInterface)->pEntity);
break;
case ENTITY_TYPE_VEHICLE:
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface)->pEntity);
break;
case ENTITY_TYPE_OBJECT:
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface)->pEntity);
break;
default:
break;
@@ -222,13 +222,13 @@ CEntity* CPhysicalSA::GetDamageEntity(void)
switch (pInterface->nType)
{
case ENTITY_TYPE_PED:
pReturn = (CEntity*)(pPools->GetPed((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetPed((DWORD*)pInterface)->pEntity);
break;
case ENTITY_TYPE_VEHICLE:
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface)->pEntity);
break;
case ENTITY_TYPE_OBJECT:
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface)->pEntity);
break;
default:
break;
@@ -261,13 +261,13 @@ CEntity* CPhysicalSA::GetAttachedEntity(void)
switch (pInterface->nType)
{
case ENTITY_TYPE_PED:
pReturn = (CEntity*)(pPools->GetPed((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetPed((DWORD*)pInterface)->pEntity);
break;
case ENTITY_TYPE_VEHICLE:
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetVehicle((DWORD*)pInterface)->pEntity);
break;
case ENTITY_TYPE_OBJECT:
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface));
pReturn = (CEntity*)(pPools->GetObject((DWORD*)pInterface)->pEntity);
break;
default:
break;
@@ -494,7 +494,7 @@ int GetAnimPose(int iAnim)
////////////////////////////////////////////////////////////////
__declspec(noinline) int _cdecl OnCPlayerPed_ProcessAnimGroups_Mid(CPlayerPedSAInterface* pPlayerPedSAInterface, int iReqMoveAnim)
{
CPed* pPed = pGame->GetPools()->GetPed((DWORD*)pPlayerPedSAInterface);
CPed* pPed = pGame->GetPools()->GetPed((DWORD*)pPlayerPedSAInterface)->pEntity;

if (pPed)
{
Oops, something went wrong.

0 comments on commit b6a3254

Please sign in to comment.