Skip to content

Commit 9ca0728

Browse files
committed
chore(PlayerManager): Safety Check
1 parent ccf6800 commit 9ca0728

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/player/PlayerManager.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,8 @@ class PlayerManager
1919
uint16_t GetPlayers();
2020
Player *GetPlayer(uint16 slot)
2121
{
22+
if(slot < 0 || slot > MAX_PLAYERS) return nullptr;
23+
2224
return this->g_Players[slot];
2325
}
2426
Player *GetPlayer(CPlayerSlot slot) { return this->g_Players[slot.Get()]; }

0 commit comments

Comments
 (0)