[saco] Implement CActorPool ctor

This commit is contained in:
RD42 2024-02-12 20:12:15 +08:00
parent 05309cad36
commit 864ab50d1e
7 changed files with 49 additions and 1 deletions

View File

@ -4,6 +4,7 @@
#include <windows.h> #include <windows.h>
#define MAX_PLAYERS 1004 #define MAX_PLAYERS 1004
#define MAX_ACTORS 1000
#define MAX_VEHICLES 2000 #define MAX_VEHICLES 2000
#define MAX_OBJECTS 1000 #define MAX_OBJECTS 1000
#define PLAYER_PED_SLOTS 210 #define PLAYER_PED_SLOTS 210
@ -11,6 +12,7 @@
//----------------------------------------------------------- //-----------------------------------------------------------
typedef unsigned short VEHICLEID; typedef unsigned short VEHICLEID;
typedef unsigned short ACTORID;
typedef unsigned short PLAYERID; typedef unsigned short PLAYERID;
typedef struct _VECTOR { typedef struct _VECTOR {

View File

@ -30,6 +30,7 @@ typedef struct _GAME_SETTINGS {
#include "../raknet/GetTime.h" #include "../raknet/GetTime.h"
#include "net/netrpc.h" #include "net/netrpc.h"
#include "net/actorpool.h"
#include "net/vehiclepool.h" #include "net/vehiclepool.h"
#include "net/pickuppool.h" #include "net/pickuppool.h"
#include "net/objectpool.h" #include "net/objectpool.h"

16
saco/net/actorpool.cpp Normal file
View File

@ -0,0 +1,16 @@
#include "../main.h"
//----------------------------------------------------
CActorPool::CActorPool()
{
for(ACTORID ActorID = 0; ActorID < MAX_ACTORS; ActorID++) {
field_FA4[ActorID] = 0;
field_4[ActorID] = 0;
field_1F44[ActorID] = 0;
}
field_0 = 0;
}
//----------------------------------------------------

21
saco/net/actorpool.h Normal file
View File

@ -0,0 +1,21 @@
#pragma once
//----------------------------------------------------
class CActorPool
{
private:
int field_0;
int field_4[MAX_ACTORS];
int field_FA4[MAX_ACTORS];
int field_1F44[MAX_ACTORS];
char _gap2EE4[8000];
public:
CActorPool();
};
//----------------------------------------------------

View File

@ -37,6 +37,7 @@ void CNetGame::InitPools()
m_pPools->pPlayerPool = new CPlayerPool(); m_pPools->pPlayerPool = new CPlayerPool();
m_pPools->pVehiclePool = new CVehiclePool(); m_pPools->pVehiclePool = new CVehiclePool();
m_pPools->pPickupPool = new CPickupPool(); m_pPools->pPickupPool = new CPickupPool();
m_pPools->pActorPool = new CActorPool();
} }
DWORD CNetGame::GetTime() DWORD CNetGame::GetTime()

View File

@ -30,7 +30,8 @@ typedef struct _NETGAME_POOLS {
CPlayerPool *pPlayerPool; CPlayerPool *pPlayerPool;
CPickupPool *pPickupPool; CPickupPool *pPickupPool;
CObjectPool *pObjectPool; CObjectPool *pObjectPool;
char _gap0[20]; CActorPool *pActorPool;
char _gap0[16];
} NETGAME_POOLS; } NETGAME_POOLS;
class CNetGame // size: 994 class CNetGame // size: 994

View File

@ -246,6 +246,12 @@
<Filter <Filter
Name="net" Name="net"
Filter=""> Filter="">
<File
RelativePath=".\net\actorpool.cpp">
</File>
<File
RelativePath=".\net\actorpool.h">
</File>
<File <File
RelativePath=".\net\netgame.cpp"> RelativePath=".\net\netgame.cpp">
</File> </File>