mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 14:37:29 +08:00
[server] Implement CObjectPool ctor/dtor
This commit is contained in:
parent
0542a9e8fe
commit
16540743b8
@ -8,6 +8,7 @@
|
||||
|
||||
#define MAX_PLAYERS 1000
|
||||
#define MAX_VEHICLES 2000
|
||||
#define MAX_OBJECTS 1000
|
||||
#define MAX_MENUS 128
|
||||
#define MAX_TEXT_DRAWS 2048
|
||||
#define MAX_GANG_ZONES 1024
|
||||
|
@ -0,0 +1,42 @@
|
||||
|
||||
#include "main.h"
|
||||
|
||||
CObjectPool::CObjectPool()
|
||||
{
|
||||
for(WORD wObjectID = 0; wObjectID != MAX_OBJECTS; wObjectID++) {
|
||||
field_7A21A0[wObjectID] = 0;
|
||||
field_7A3140[wObjectID] = 0;
|
||||
field_3D0900[wObjectID] = 0;
|
||||
for (int i = 0; i < MAX_PLAYERS; i++)
|
||||
{
|
||||
field_0[i][wObjectID] = 0;
|
||||
field_3D18A0[i][wObjectID] = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
CObjectPool::~CObjectPool()
|
||||
{
|
||||
for(WORD wObjectID = 0; wObjectID != MAX_OBJECTS; wObjectID++) {
|
||||
if(!Delete(wObjectID) && field_3D0900[wObjectID])
|
||||
{
|
||||
// Try delete it for individuals
|
||||
for (PLAYERID playerId = 0; playerId < MAX_PLAYERS; playerId++)
|
||||
{
|
||||
DeleteForPlayer(playerId, wObjectID);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
BOOL CObjectPool::Delete(WORD wObjectID)
|
||||
{
|
||||
// TODO: CObjectPool::Delete W .text:004657A0 L .text:080C89A0
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
BOOL CObjectPool::DeleteForPlayer(PLAYERID playerId, WORD wObjectID)
|
||||
{
|
||||
// TODO: CObjectPool::DeleteForPlayer W .text:004656B0 L .text:080C88E0
|
||||
return FALSE;
|
||||
}
|
@ -5,7 +5,19 @@
|
||||
class CObjectPool // size: WL 8012000
|
||||
{
|
||||
private:
|
||||
char _gap0[8012000];
|
||||
|
||||
int field_0[1000][1000];
|
||||
int field_3D0900[1000];
|
||||
int field_3D18A0[1000][1000];
|
||||
int field_7A21A0[1000];
|
||||
int field_7A3140[1000];
|
||||
|
||||
public:
|
||||
CObjectPool();
|
||||
~CObjectPool();
|
||||
|
||||
BOOL Delete(WORD wObjectID);
|
||||
BOOL DeleteForPlayer(PLAYERID playerId, WORD wObjectID);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user