From 4c4329f013c3afd0d1e1e67e521f366b90bb8c1e Mon Sep 17 00:00:00 2001 From: ricardoofnl Date: Sat, 5 Sep 2026 07:54:05 +0700 Subject: [PATCH] [saco] Match `CPlayerPool::GetPlayerName`; folding the range guard into the pointer initializer coalesces it onto `this` --- saco/net/playerpool.h | 13 ++++--------- 1 file changed, 4 insertions(+), 9 deletions(-) diff --git a/saco/net/playerpool.h b/saco/net/playerpool.h index bfe1392..cb53c20 100644 --- a/saco/net/playerpool.h +++ b/saco/net/playerpool.h @@ -36,15 +36,10 @@ public: } PCHAR GetPlayerName(PLAYERID playerId) { // .text:100175C0 - PCHAR szName; - if(playerId == m_LocalPlayerID) szName = (PCHAR)field_6.c_str(); - else if(playerId > MAX_PLAYERS) szName = NULL; - else { - CNetPlayer *pPlayer = m_pPlayers[playerId]; - if(!pPlayer) szName = NULL; - else szName = pPlayer->GetName(); - } - return szName; + if(playerId == m_LocalPlayerID) return (PCHAR)field_6.c_str(); + CNetPlayer *pPlayer = playerId > MAX_PLAYERS ? NULL : m_pPlayers[playerId]; + if(!pPlayer) return NULL; + return pPlayer->GetName(); }; CLocalPlayer * GetLocalPlayer() { return m_pLocalPlayer; };