[server] Implement and match n_GetActorPoolSize(...)

This commit is contained in:
RD42 2024-04-27 18:25:01 +08:00
parent 026d199e61
commit 7f97bd273f
4 changed files with 15 additions and 4 deletions

View File

@ -9,7 +9,7 @@ CActorPool::CActorPool()
field_FA0[ActorID] = 0; field_FA0[ActorID] = 0;
field_1F40[ActorID] = 0; field_1F40[ActorID] = 0;
} }
field_2EE0 = 0; m_iPoolSize = 0;
} }
CActorPool::~CActorPool() CActorPool::~CActorPool()

View File

@ -8,12 +8,14 @@ private:
int field_0[1000]; int field_0[1000];
int field_FA0[1000]; int field_FA0[1000];
int field_1F40[1000]; int field_1F40[1000];
int field_2EE0; int m_iPoolSize;
public: public:
CActorPool(); CActorPool();
~CActorPool(); ~CActorPool();
BOOL Delete(ACTORID ActorID); BOOL Delete(ACTORID ActorID);
int GetPoolSize() { return m_iPoolSize; };
}; };
#endif #endif

View File

@ -82,6 +82,7 @@ public:
RakServerInterface * GetRakServer() { return m_pRak; }; RakServerInterface * GetRakServer() { return m_pRak; };
CGameMode * GetGameMode() { return m_pGameMode; }; CGameMode * GetGameMode() { return m_pGameMode; };
CFilterScripts * GetFilterScripts() { return m_pFilterScripts; }; CFilterScripts * GetFilterScripts() { return m_pFilterScripts; };
CActorPool * GetActorPool() { return m_pActorPool; };
char *GetNextScriptFile(); char *GetNextScriptFile();
void LoadAllFilterscripts(); void LoadAllFilterscripts();

View File

@ -33,12 +33,20 @@ static cell AMX_NATIVE_CALL n_GetVehiclePoolSize(AMX *amx, cell *params)
return -1; return -1;
} }
//----------------------------------------------------------------------------------
// native GetActorPoolSize()
static cell AMX_NATIVE_CALL n_GetActorPoolSize(AMX *amx, cell *params) static cell AMX_NATIVE_CALL n_GetActorPoolSize(AMX *amx, cell *params)
{ {
// TODO: GetActorPoolSize if(!pNetGame) return -1;
return 0; CActorPool *pActorPool = pNetGame->GetActorPool();
if(pActorPool) {
return pActorPool->GetPoolSize();
}
return -1;
} }
//----------------------------------------------------------------------------------
static cell AMX_NATIVE_CALL n_print(AMX *amx, cell *params) static cell AMX_NATIVE_CALL n_print(AMX *amx, cell *params)
{ {
// TODO: print // TODO: print