diff --git a/server/actorpool.cpp b/server/actorpool.cpp index c86ad7f..2d06bac 100644 --- a/server/actorpool.cpp +++ b/server/actorpool.cpp @@ -9,7 +9,7 @@ CActorPool::CActorPool() field_FA0[ActorID] = 0; field_1F40[ActorID] = 0; } - field_2EE0 = 0; + m_iPoolSize = 0; } CActorPool::~CActorPool() diff --git a/server/actorpool.h b/server/actorpool.h index f9c7c4a..7125234 100644 --- a/server/actorpool.h +++ b/server/actorpool.h @@ -8,12 +8,14 @@ private: int field_0[1000]; int field_FA0[1000]; int field_1F40[1000]; - int field_2EE0; + int m_iPoolSize; public: CActorPool(); ~CActorPool(); BOOL Delete(ACTORID ActorID); + + int GetPoolSize() { return m_iPoolSize; }; }; #endif diff --git a/server/netgame.h b/server/netgame.h index e790cc9..6a0e139 100644 --- a/server/netgame.h +++ b/server/netgame.h @@ -82,6 +82,7 @@ public: RakServerInterface * GetRakServer() { return m_pRak; }; CGameMode * GetGameMode() { return m_pGameMode; }; CFilterScripts * GetFilterScripts() { return m_pFilterScripts; }; + CActorPool * GetActorPool() { return m_pActorPool; }; char *GetNextScriptFile(); void LoadAllFilterscripts(); diff --git a/server/scrcustom.cpp b/server/scrcustom.cpp index 0bf9a1a..b0082b8 100644 --- a/server/scrcustom.cpp +++ b/server/scrcustom.cpp @@ -33,12 +33,20 @@ static cell AMX_NATIVE_CALL n_GetVehiclePoolSize(AMX *amx, cell *params) return -1; } +//---------------------------------------------------------------------------------- +// native GetActorPoolSize() static cell AMX_NATIVE_CALL n_GetActorPoolSize(AMX *amx, cell *params) { - // TODO: GetActorPoolSize - return 0; + if(!pNetGame) return -1; + CActorPool *pActorPool = pNetGame->GetActorPool(); + if(pActorPool) { + return pActorPool->GetPoolSize(); + } + return -1; } +//---------------------------------------------------------------------------------- + static cell AMX_NATIVE_CALL n_print(AMX *amx, cell *params) { // TODO: print