[saco] Implement/match CPickupPool destructor

* Update CPickupPool constructor
This commit is contained in:
RD42 2024-08-21 23:23:07 +08:00
parent 74eded7b21
commit 8154fb5da2
3 changed files with 19 additions and 2 deletions

View File

@ -90,6 +90,8 @@ const SCRIPT_COMMAND text_clear_all = { 0x00be, "" };
const SCRIPT_COMMAND create_pickup_with_ammo = { 0x032b, "iiifffv" };
const SCRIPT_COMMAND destroy_pickup = { 0x0215, "i" };
const SCRIPT_COMMAND link_vehicle_to_interior = { 0x0840, "ii" };
const SCRIPT_COMMAND create_radar_marker_icon = { 0x0570, "fffiv" };

View File

@ -9,10 +9,24 @@ CPickupPool::CPickupPool()
field_0 = 0;
for (int i = 0; i < MAX_PICKUPS; i++)
{
field_4[i] = 0;
m_dwHnd[i] = NULL;
field_8004[i] = 0;
field_4004[i] = -1;
}
}
//----------------------------------------------------
CPickupPool::~CPickupPool()
{
for(int i = 0; i < MAX_PICKUPS; i++)
{
if (m_dwHnd[i] != NULL)
{
ScriptCommand(&destroy_pickup, m_dwHnd[i]);
}
}
}
//----------------------------------------------------

View File

@ -10,7 +10,7 @@ class CPickupPool
private:
int field_0;
int field_4[MAX_PICKUPS];
DWORD m_dwHnd[MAX_PICKUPS];
int field_4004[MAX_PICKUPS];
int field_8004[MAX_PICKUPS];
@ -21,6 +21,7 @@ private:
public:
CPickupPool();
~CPickupPool();
};