[saco] Match FUNC_10004280; GetAt is called twice and the pool bound check folds into GetSlotState

This commit is contained in:
ricardoofnl
2026-09-05 09:31:29 +07:00
parent 2cf8455402
commit 5baa271d74
2 changed files with 17 additions and 0 deletions
+16
View File
@@ -571,3 +571,19 @@ void CLocalPlayer::FUNC_100041C0(BOOL bSpectating)
field_314 = 0;
field_310 = -1;
}
//----------------------------------------------------
// picks a player to spectate; state 32 is not a spectatable one
void CLocalPlayer::FUNC_10004280(PLAYERID playerId)
{
CPlayerPool *pPlayerPool = pNetGame->GetPlayerPool();
if(pPlayerPool && pPlayerPool->GetSlotState(playerId) && pPlayerPool->GetAt(playerId)->field_10A
&& pPlayerPool->GetAt(playerId)->field_10A != 32)
{
field_30F = 1;
field_310 = playerId;
field_314 = 0;
}
}
+1
View File
@@ -151,6 +151,7 @@ public:
BOOL FUNC_10003A60(void *a2, void *a3, unsigned int a4); // .text:10003A60
void FUNC_10004080(); // .text:10004080
void FUNC_10004230(WORD a1); // .text:10004230
void FUNC_10004280(PLAYERID playerId); // .text:10004280
void FUNC_10003F50(); // .text:10003F50
void FUNC_100041C0(BOOL bSpectating); // .text:100041C0