From 1002c134536a8a25881edc4fd5bcd01398e11427 Mon Sep 17 00:00:00 2001 From: RD42 <42702181+dashr9230@users.noreply.github.com> Date: Wed, 7 Feb 2024 23:59:04 +0800 Subject: [PATCH] [saco] Implement CPickupPool constructor --- saco/main.h | 1 + saco/net/netgame.cpp | 1 + saco/net/netgame.h | 3 ++- saco/net/pickuppool.cpp | 18 ++++++++++++++++++ saco/net/pickuppool.h | 27 +++++++++++++++++++++++++++ saco/saco.vcproj | 6 ++++++ 6 files changed, 55 insertions(+), 1 deletion(-) create mode 100644 saco/net/pickuppool.cpp create mode 100644 saco/net/pickuppool.h diff --git a/saco/main.h b/saco/main.h index 84d85da..d4e14e4 100644 --- a/saco/main.h +++ b/saco/main.h @@ -31,6 +31,7 @@ typedef struct _GAME_SETTINGS { #include "net/netrpc.h" #include "net/vehiclepool.h" +#include "net/pickuppool.h" #include "net/netgame.h" #include "net/scriptrpc.h" diff --git a/saco/net/netgame.cpp b/saco/net/netgame.cpp index d2d7ce4..7fab310 100644 --- a/saco/net/netgame.cpp +++ b/saco/net/netgame.cpp @@ -35,6 +35,7 @@ void CNetGame::InitPools() m_pPools->pPlayerPool = new CPlayerPool(); m_pPools->pVehiclePool = new CVehiclePool(); + m_pPools->pPickupPool = new CPickupPool(); } DWORD CNetGame::GetTime() diff --git a/saco/net/netgame.h b/saco/net/netgame.h index 4e22f7b..cab05e2 100644 --- a/saco/net/netgame.h +++ b/saco/net/netgame.h @@ -28,7 +28,8 @@ struct struc_41 typedef struct _NETGAME_POOLS { CVehiclePool *pVehiclePool; CPlayerPool *pPlayerPool; - char _gap0[28]; + CPickupPool *pPickupPool; + char _gap0[24]; } NETGAME_POOLS; class CNetGame // size: 994 diff --git a/saco/net/pickuppool.cpp b/saco/net/pickuppool.cpp new file mode 100644 index 0000000..f74b607 --- /dev/null +++ b/saco/net/pickuppool.cpp @@ -0,0 +1,18 @@ + +#include "../main.h" + +//---------------------------------------------------- + +CPickupPool::CPickupPool() +{ + memset(field_F004, 0, sizeof(field_F004)); + field_0 = 0; + for (int i = 0; i < MAX_PICKUPS; i++) + { + field_4[i] = 0; + field_8004[i] = 0; + field_4004[i] = 0; + } +} + +//---------------------------------------------------- diff --git a/saco/net/pickuppool.h b/saco/net/pickuppool.h new file mode 100644 index 0000000..91caf66 --- /dev/null +++ b/saco/net/pickuppool.h @@ -0,0 +1,27 @@ + +#pragma once + +#define MAX_PICKUPS 4096 + +//---------------------------------------------------- + +class CPickupPool +{ +private: + + int field_0; + int field_4[MAX_PICKUPS]; + int field_4004[MAX_PICKUPS]; + int field_8004[MAX_PICKUPS]; + + char _gapC004[12288]; + + char field_F004[81920]; + +public: + + CPickupPool(); + +}; + +//---------------------------------------------------- \ No newline at end of file diff --git a/saco/saco.vcproj b/saco/saco.vcproj index c490855..617c7e7 100644 --- a/saco/saco.vcproj +++ b/saco/saco.vcproj @@ -258,6 +258,12 @@ + + + +