[server] Implement/match CGangZonePool::New(...)

* Update CGangZonePool constructor
This commit is contained in:
RD42 2024-09-21 21:56:34 +08:00
parent 5c6af25c40
commit 4c09be8e80
2 changed files with 25 additions and 6 deletions

View File

@ -5,9 +5,23 @@ CGangZonePool::CGangZonePool()
{
for (WORD wZone = 0; wZone < MAX_GANG_ZONES; wZone++)
{
field_4000[wZone] = 0;
m_bSlotState[wZone] = FALSE;
}
}
WORD CGangZonePool::New(float fMinX, float fMinY, float fMaxX, float fMaxY)
{
WORD wZone = 0;
while (wZone < MAX_GANG_ZONES)
{
if (!m_bSlotState[wZone]) break;
wZone++;
}
if (wZone == MAX_GANG_ZONES) return 0xFFFF;
m_fGangZone[wZone][0] = fMinX;
m_fGangZone[wZone][1] = fMinY;
m_fGangZone[wZone][2] = fMaxX;
m_fGangZone[wZone][3] = fMaxY;
m_bSlotState[wZone] = TRUE;
return wZone;
}

View File

@ -2,14 +2,19 @@
#ifndef SAMPSRV_GANGZONEPOOL_H
#define SAMPSRV_GANGZONEPOOL_H
class CGangZonePool // size: WL 20480
//----------------------------------------------------
class CGangZonePool
{
private:
char gap0[16384];
int field_4000[1024];
float m_fGangZone[MAX_GANG_ZONES][4];
BOOL m_bSlotState[MAX_GANG_ZONES];
public:
CGangZonePool();
~CGangZonePool() {};
WORD New(float fMinX, float fMinY, float fMaxX, float fMaxY);
};
//----------------------------------------------------
#endif