diff --git a/bot/main.h b/bot/main.h index 9066dfb..a880be5 100644 --- a/bot/main.h +++ b/bot/main.h @@ -13,6 +13,7 @@ #endif #define MAX_PLAYER_NAME 24 +#define MAX_PLAYERS 1000 #define MAX_SETTINGS_STRING 256 typedef struct _GAME_SETTINGS { @@ -30,6 +31,8 @@ typedef struct _GAME_SETTINGS { #include "../raknet/RakNetworkFactory.h" #include "../raknet/PacketEnumerations.h" #include "../raknet/SAMPRPC.h" + +typedef unsigned short PLAYERID; #include "scrtimers.h" #include "npcmode.h" diff --git a/bot/net/playerpool.cpp b/bot/net/playerpool.cpp index 840a492..dee72bb 100644 --- a/bot/net/playerpool.cpp +++ b/bot/net/playerpool.cpp @@ -1,14 +1,19 @@ -#include "playerpool.h" +#include "../main.h" + +//---------------------------------------------------- CPlayerPool::CPlayerPool() { - // TODO: CPlayerPool::CPlayerPool W: 004196A0 L: 080B1F4E field_7163 = 0; field_8107 = 0; - for(unsigned short i = 0; i < 1000; i++) { - field_0[i] = 0; - field_7167[i] = 0; - field_810B[i] = 0; + + // loop through and initialize all net players to null and slot states to false + for(PLAYERID playerId = 0; playerId < MAX_PLAYERS; playerId++) { + field_0[playerId] = 0; + field_7167[playerId] = 0; + field_810B[playerId] = 0; } } + +//----------------------------------------------------