feat(Core): Added ABORT() macro to prevent the usage of ASSERT(false) as a quick hack to crash the core misusing assert (#2273)

This commit is contained in:
Viste
2019-09-26 10:51:34 +03:00
committed by Stoabrogga
parent 58f3cfe387
commit 854b426978
28 changed files with 127 additions and 74 deletions

View File

@@ -4052,7 +4052,7 @@ void Unit::_UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode)
else
++iter;
}
ASSERT(false);
ABORT();
}
void Unit::_RemoveNoStackAurasDueToAura(Aura* aura)
@@ -4145,7 +4145,7 @@ void Unit::RemoveOwnedAura(Aura* aura, AuraRemoveMode removeMode)
}
}
ASSERT(false);
ABORT();
}
Aura* Unit::GetOwnedAura(uint32 spellId, uint64 casterGUID, uint64 itemCasterGUID, uint8 reqEffMask, Aura* except) const
@@ -9895,7 +9895,7 @@ void Unit::SetMinion(Minion *minion, bool apply)
{
OutDebugInfo();
(*itr)->OutDebugInfo();
ASSERT(false);
ABORT();
}
ASSERT((*itr)->GetTypeId() == TYPEID_UNIT);
@@ -14377,7 +14377,7 @@ void Unit::RemoveFromWorld()
if (GetCharmerGUID())
{
sLog->outCrash("Unit %u has charmer guid when removed from world", GetEntry());
ASSERT(false);
ABORT();
}
if (Unit* owner = GetOwner())
@@ -14387,7 +14387,7 @@ void Unit::RemoveFromWorld()
if (HasUnitTypeMask(UNIT_MASK_MINION|UNIT_MASK_GUARDIAN))
owner->SetMinion((Minion*)this, false);
sLog->outString("Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry());
//ASSERT(false);
//ABORT();
}
}
@@ -17151,7 +17151,7 @@ void Unit::RemoveCharmedBy(Unit* charmer)
{
// sLog->outCrash("Unit::RemoveCharmedBy: this: " UI64FMTD " true charmer: " UI64FMTD " false charmer: " UI64FMTD,
// GetGUID(), GetCharmerGUID(), charmer->GetGUID());
// ASSERT(false);
// ABORT();
return;
}
@@ -18260,7 +18260,7 @@ void Unit::ChangeSeat(int8 seatId, bool next)
m_vehicle->RemovePassenger(this);
if (!m_vehicle->AddPassenger(this, seatId))
ASSERT(false);
ABORT();
}
void Unit::ExitVehicle(Position const* /*exitPosition*/)