diff --git a/server/gangzonepool.cpp b/server/gangzonepool.cpp index 80a9f5e..540fa78 100644 --- a/server/gangzonepool.cpp +++ b/server/gangzonepool.cpp @@ -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; +} diff --git a/server/gangzonepool.h b/server/gangzonepool.h index e5b7a02..dd286e3 100644 --- a/server/gangzonepool.h +++ b/server/gangzonepool.h @@ -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