[server] Implement/match n_GangZoneDestroy(...)

This commit is contained in:
RD42 2024-09-21 22:33:41 +08:00
parent 473e9a76e5
commit 5cd459179d
3 changed files with 11 additions and 2 deletions

View File

@ -22,6 +22,11 @@ public:
void FlashForAll(WORD wZone, DWORD dwColor);
void StopFlashForPlayer(PLAYERID playerId, WORD wZone);
void StopFlashForAll(WORD wZone);
BOOL GetSlotState(WORD wZone)
{
if (wZone >= MAX_GANG_ZONES) return FALSE;
return m_bSlotState[wZone];
};
};
//----------------------------------------------------

View File

@ -85,6 +85,7 @@ public:
RakServerInterface * GetRakServer() { return m_pRak; };
CGameMode * GetGameMode() { return m_pGameMode; };
CFilterScripts * GetFilterScripts() { return m_pFilterScripts; };
CGangZonePool * GetGangZonePool() { return m_pGangZonePool; };
CActorPool * GetActorPool() { return m_pActorPool; };
void MasterServerAnnounce(float fElapsedTime);

View File

@ -590,10 +590,13 @@ static cell AMX_NATIVE_CALL n_GangZoneCreate(AMX *amx, cell *params)
return 0;
}
// native GangZoneDestroy(zone)
static cell AMX_NATIVE_CALL n_GangZoneDestroy(AMX *amx, cell *params)
{
// TODO: GangZoneDestroy
return 0;
CGangZonePool *pGangZonePool = pNetGame->GetGangZonePool();
if (!pGangZonePool || !pGangZonePool->GetSlotState(params[1])) return 0;
pGangZonePool->Delete(params[1]);
return 1;
}
static cell AMX_NATIVE_CALL n_GangZoneShowForPlayer(AMX *amx, cell *params)