[server] Add CMenuPool ctor/dtor

This commit is contained in:
RD42 2023-11-25 23:49:51 +08:00
parent a9834084b4
commit fe3f39d3a7
3 changed files with 37 additions and 1 deletions

View File

@ -8,7 +8,9 @@
#define MAX_PLAYERS 1000 #define MAX_PLAYERS 1000
#define MAX_VEHICLES 2000 #define MAX_VEHICLES 2000
#define MAX_MENUS 128
#define MAX_TEXT_DRAWS 2048 #define MAX_TEXT_DRAWS 2048
#define MAX_GANG_ZONES 1024
#define DEFAULT_MAX_PLAYERS 50 #define DEFAULT_MAX_PLAYERS 50
#define DEFAULT_LISTEN_PORT 8192 #define DEFAULT_LISTEN_PORT 8192

View File

@ -0,0 +1,28 @@
#include "main.h"
CMenuPool::CMenuPool()
{
for (BYTE byteMenuID = 0; byteMenuID < MAX_MENUS; byteMenuID++)
{
field_200[byteMenuID] = 0;
field_0[byteMenuID] = 0;
}
for (PLAYERID Player = 0; Player < MAX_PLAYERS; Player++)
{
field_400[Player] = 255;
}
}
CMenuPool::~CMenuPool()
{
for (BYTE byteMenuID = 0; byteMenuID < MAX_MENUS; byteMenuID++)
{
if (field_0[byteMenuID])
{
delete field_0[byteMenuID];
field_0[byteMenuID] = NULL;
}
}
}

View File

@ -5,7 +5,13 @@
class CMenuPool // size: WL 2024 class CMenuPool // size: WL 2024
{ {
private: private:
char _gap0[2024]; int* field_0[128];
int field_200[128];
char field_400[1000];
public:
CMenuPool();
~CMenuPool();
}; };
#endif #endif