mirror of
https://github.com/dashr9230/SA-MP.git
synced 2024-12-22 22:47:29 +08:00
[saco] Implement CObjectPool ctor
This commit is contained in:
parent
1cb324b4fe
commit
05309cad36
@ -5,6 +5,7 @@
|
||||
|
||||
#define MAX_PLAYERS 1004
|
||||
#define MAX_VEHICLES 2000
|
||||
#define MAX_OBJECTS 1000
|
||||
#define PLAYER_PED_SLOTS 210
|
||||
|
||||
//-----------------------------------------------------------
|
||||
|
@ -32,6 +32,7 @@ typedef struct _GAME_SETTINGS {
|
||||
#include "net/netrpc.h"
|
||||
#include "net/vehiclepool.h"
|
||||
#include "net/pickuppool.h"
|
||||
#include "net/objectpool.h"
|
||||
#include "net/netgame.h"
|
||||
#include "net/scriptrpc.h"
|
||||
|
||||
|
@ -33,6 +33,7 @@ void CNetGame::InitPools()
|
||||
{
|
||||
m_pPools = (NETGAME_POOLS *)calloc(1, sizeof(NETGAME_POOLS));
|
||||
|
||||
m_pPools->pObjectPool = new CObjectPool();
|
||||
m_pPools->pPlayerPool = new CPlayerPool();
|
||||
m_pPools->pVehiclePool = new CVehiclePool();
|
||||
m_pPools->pPickupPool = new CPickupPool();
|
||||
|
@ -29,7 +29,8 @@ typedef struct _NETGAME_POOLS {
|
||||
CVehiclePool *pVehiclePool;
|
||||
CPlayerPool *pPlayerPool;
|
||||
CPickupPool *pPickupPool;
|
||||
char _gap0[24];
|
||||
CObjectPool *pObjectPool;
|
||||
char _gap0[20];
|
||||
} NETGAME_POOLS;
|
||||
|
||||
class CNetGame // size: 994
|
||||
|
12
saco/net/objectpool.cpp
Normal file
12
saco/net/objectpool.cpp
Normal file
@ -0,0 +1,12 @@
|
||||
|
||||
#include "../main.h"
|
||||
|
||||
CObjectPool::CObjectPool()
|
||||
{
|
||||
for(WORD wObjectID = 0; wObjectID < MAX_OBJECTS; wObjectID++)
|
||||
{
|
||||
field_4[wObjectID] = 0;
|
||||
field_FA4[wObjectID] = 0;
|
||||
}
|
||||
field_0 = 0;
|
||||
};
|
13
saco/net/objectpool.h
Normal file
13
saco/net/objectpool.h
Normal file
@ -0,0 +1,13 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
class CObjectPool
|
||||
{
|
||||
private:
|
||||
int field_0;
|
||||
int field_4[MAX_OBJECTS];
|
||||
int field_FA4[MAX_OBJECTS];
|
||||
public:
|
||||
CObjectPool();
|
||||
|
||||
};
|
@ -258,6 +258,12 @@
|
||||
<File
|
||||
RelativePath=".\net\netrpc.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\net\objectpool.cpp">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\net\objectpool.h">
|
||||
</File>
|
||||
<File
|
||||
RelativePath=".\net\pickuppool.cpp">
|
||||
</File>
|
||||
|
Loading…
Reference in New Issue
Block a user