1
0
mirror of https://github.com/VCMP-SqMod/SqMod.git synced 2025-06-19 16:47:14 +02:00

Revise the entity clean up to fix crash at server shutdown, remove duplicate code and overall make the code more reliable.

Various other minor changes surrounding the entity destruction from the server.
This commit is contained in:
Sandu Liviu Catalin
2016-07-16 19:39:51 +03:00
parent 88765b80c0
commit 1229e7f59f
4 changed files with 162 additions and 345 deletions

View File

@ -4,6 +4,43 @@
// ------------------------------------------------------------------------------------------------
namespace SqMod {
// ------------------------------------------------------------------------------------------------
void Core::ClearContainer(EntityType type)
{
switch (type)
{
case ENT_BLIP:
{
m_Blips.clear();
} break;
case ENT_CHECKPOINT:
{
m_Checkpoints.clear();
} break;
case ENT_KEYBIND:
{
m_Keybinds.clear();
} break;
case ENT_OBJECT:
{
m_Objects.clear();
} break;
case ENT_PICKUP:
{
m_Pickups.clear();
} break;
case ENT_PLAYER:
{
m_Players.clear();
} break;
case ENT_VEHICLE:
{
m_Vehicles.clear();
} break;
default: STHROWF("Cannot clear unknown entity type container");
}
}
// ------------------------------------------------------------------------------------------------
void Core::ResetInst(BlipInst & inst)
{