*use ASSERT macro instead of regular assert for better output.
--HG-- branch : trunk
This commit is contained in:
@@ -137,7 +137,7 @@ void Corpse::SaveToDB()
|
||||
|
||||
void Corpse::DeleteBonesFromWorld()
|
||||
{
|
||||
assert(GetType() == CORPSE_BONES);
|
||||
ASSERT(GetType() == CORPSE_BONES);
|
||||
Corpse* corpse = ObjectAccessor::GetCorpse(*this, GetGUID());
|
||||
|
||||
if (!corpse)
|
||||
|
||||
@@ -1959,7 +1959,7 @@ bool Creature::CanAssistTo(const Unit* u, const Unit* enemy, bool checkfaction /
|
||||
// friendlies and other mobs they shouldn't attack
|
||||
bool Creature::_IsTargetAcceptable(const Unit *target) const
|
||||
{
|
||||
assert(target);
|
||||
ASSERT(target);
|
||||
|
||||
// if the target cannot be attacked, the target is not acceptable
|
||||
if (IsFriendlyTo(target)
|
||||
|
||||
@@ -168,7 +168,7 @@ void TempSummon::Update(uint32 diff)
|
||||
|
||||
void TempSummon::InitStats(uint32 duration)
|
||||
{
|
||||
assert(!isPet());
|
||||
ASSERT(!isPet());
|
||||
|
||||
m_timer = duration;
|
||||
m_lifetime = duration;
|
||||
@@ -228,11 +228,11 @@ void TempSummon::SetTempSummonType(TempSummonType type)
|
||||
|
||||
void TempSummon::UnSummon()
|
||||
{
|
||||
//assert(!isPet());
|
||||
//ASSERT(!isPet());
|
||||
if (isPet())
|
||||
{
|
||||
((Pet*)this)->Remove(PET_SAVE_NOT_IN_SLOT);
|
||||
assert(!IsInWorld());
|
||||
ASSERT(!IsInWorld());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -267,7 +267,7 @@ void TempSummon::SaveToDB()
|
||||
Minion::Minion(SummonPropertiesEntry const *properties, Unit *owner) : TempSummon(properties, owner)
|
||||
, m_owner(owner)
|
||||
{
|
||||
assert(m_owner);
|
||||
ASSERT(m_owner);
|
||||
m_unitTypeMask |= UNIT_MASK_MINION;
|
||||
m_followAngle = PET_FOLLOW_ANGLE;
|
||||
}
|
||||
@@ -333,7 +333,7 @@ void Guardian::InitSummon()
|
||||
|
||||
Puppet::Puppet(SummonPropertiesEntry const *properties, Unit *owner) : Minion(properties, owner)
|
||||
{
|
||||
assert(owner->GetTypeId() == TYPEID_PLAYER);
|
||||
ASSERT(owner->GetTypeId() == TYPEID_PLAYER);
|
||||
m_owner = (Player*)owner;
|
||||
m_unitTypeMask |= UNIT_MASK_PUPPET;
|
||||
}
|
||||
@@ -349,7 +349,7 @@ void Puppet::InitSummon()
|
||||
{
|
||||
Minion::InitSummon();
|
||||
if (!SetCharmedBy(m_owner, CHARM_TYPE_POSSESS))
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
void Puppet::Update(uint32 time)
|
||||
|
||||
@@ -40,7 +40,7 @@ class DynamicObject : public WorldObject, public GridObject<DynamicObject>
|
||||
void Delete();
|
||||
void SetDuration(int32 newDuration);
|
||||
int32 GetDuration() const;
|
||||
void SetAura(Aura * aura) {assert (!m_aura && aura); m_aura = aura;}
|
||||
void SetAura(Aura * aura) {ASSERT (!m_aura && aura); m_aura = aura;}
|
||||
void Delay(int32 delaytime);
|
||||
uint32 GetSpellId() const { return GetUInt32Value(DYNAMICOBJECT_SPELLID); }
|
||||
uint64 GetCasterGUID() const { return GetUInt64Value(DYNAMICOBJECT_CASTER); }
|
||||
|
||||
@@ -551,7 +551,7 @@ void GameObject::Delete()
|
||||
if (Unit * owner = GetOwner())
|
||||
owner->RemoveGameObject(this, false);
|
||||
|
||||
assert (!GetOwnerGUID());
|
||||
ASSERT (!GetOwnerGUID());
|
||||
SendObjectDeSpawnAnim(GetGUID());
|
||||
|
||||
SetGoState(GO_STATE_READY);
|
||||
|
||||
@@ -634,7 +634,7 @@ class GameObject : public WorldObject, public GridObject<GameObject>
|
||||
// Owner already found and different than expected owner - remove object from old owner
|
||||
if (owner && GetOwnerGUID() && GetOwnerGUID() != owner)
|
||||
{
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
m_spawnedByDefault = false; // all object with owner is despawned after delay
|
||||
SetUInt64Value(OBJECT_FIELD_CREATED_BY, owner);
|
||||
|
||||
@@ -147,7 +147,7 @@ uint32 Bag::GetFreeSlots() const
|
||||
|
||||
void Bag::RemoveItem(uint8 slot, bool /*update*/)
|
||||
{
|
||||
assert(slot < MAX_BAG_SIZE);
|
||||
ASSERT(slot < MAX_BAG_SIZE);
|
||||
|
||||
if (m_bagslot[slot])
|
||||
m_bagslot[slot]->SetContainer(NULL);
|
||||
@@ -158,7 +158,7 @@ void Bag::RemoveItem(uint8 slot, bool /*update*/)
|
||||
|
||||
void Bag::StoreItem(uint8 slot, Item *pItem, bool /*update*/)
|
||||
{
|
||||
assert(slot < MAX_BAG_SIZE);
|
||||
ASSERT(slot < MAX_BAG_SIZE);
|
||||
|
||||
if (pItem && pItem->GetGUID() != this->GetGUID())
|
||||
{
|
||||
|
||||
@@ -165,7 +165,7 @@ void RemoveItemsSetItem(Player*player,ItemPrototype const *proto)
|
||||
|
||||
if (!eff->item_count) //all items of a set were removed
|
||||
{
|
||||
assert(eff == player->ItemSetEff[setindex]);
|
||||
ASSERT(eff == player->ItemSetEff[setindex]);
|
||||
delete eff;
|
||||
player->ItemSetEff[setindex] = NULL;
|
||||
}
|
||||
@@ -1031,7 +1031,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
|
||||
if (count > pProto->GetMaxStackSize())
|
||||
count = pProto->GetMaxStackSize();
|
||||
|
||||
assert(count !=0 && "pProto->Stackable == 0 but checked at loading already");
|
||||
ASSERT(count !=0 && "pProto->Stackable == 0 but checked at loading already");
|
||||
|
||||
Item *pItem = NewItemOrBag(pProto);
|
||||
if (pItem->Create(objmgr.GenerateLowGuid(HIGHGUID_ITEM), item, player))
|
||||
@@ -1043,7 +1043,7 @@ Item* Item::CreateItem(uint32 item, uint32 count, Player const* player)
|
||||
delete pItem;
|
||||
}
|
||||
else
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
||||
@@ -89,7 +89,7 @@ WorldObject::~WorldObject()
|
||||
if (GetTypeId() == TYPEID_CORPSE)
|
||||
{
|
||||
sLog.outCrash("Object::~Object Corpse guid="UI64FMTD", type=%d, entry=%u deleted but still in map!!", GetGUID(), ((Corpse*)this)->GetType(), GetEntry());
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
ResetMap();
|
||||
}
|
||||
@@ -102,14 +102,14 @@ Object::~Object()
|
||||
sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in world!!", GetGUID(), GetTypeId(), GetEntry());
|
||||
if (isType(TYPEMASK_ITEM))
|
||||
sLog.outCrash("Item slot %u", ((Item*)this)->GetSlot());
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
RemoveFromWorld();
|
||||
}
|
||||
|
||||
if (m_objectUpdated)
|
||||
{
|
||||
sLog.outCrash("Object::~Object - guid="UI64FMTD", typeid=%d, entry=%u deleted but still in update list!!", GetGUID(), GetTypeId(), GetEntry());
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
sObjectAccessor.RemoveUpdateObject(this);
|
||||
}
|
||||
|
||||
@@ -743,7 +743,7 @@ void Object::BuildFieldsUpdate(Player *pl, UpdateDataMapType &data_map) const
|
||||
if (iter == data_map.end())
|
||||
{
|
||||
std::pair<UpdateDataMapType::iterator, bool> p = data_map.insert(UpdateDataMapType::value_type(pl, UpdateData()));
|
||||
assert(p.second);
|
||||
ASSERT(p.second);
|
||||
iter = p.first;
|
||||
}
|
||||
|
||||
@@ -1131,7 +1131,7 @@ bool Object::PrintIndexError(uint32 index, bool set) const
|
||||
{
|
||||
sLog.outError("Attempt %s non-existed value field: %u (count: %u) for object typeid: %u type mask: %u",(set ? "set value to" : "get value from"),index,m_valuesCount,GetTypeId(),m_objectType);
|
||||
|
||||
// assert must fail after function call
|
||||
// ASSERT must fail after function call
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1683,7 +1683,7 @@ void WorldObject::SetMap(Map * map)
|
||||
if (m_currMap)
|
||||
{
|
||||
sLog.outCrash("WorldObject::SetMap: obj %u new map %u %u, old map %u %u", (uint32)GetTypeId(), map->GetId(), map->GetInstanceId(), m_currMap->GetId(), m_currMap->GetInstanceId());
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
m_currMap = map;
|
||||
m_mapId = map->GetId();
|
||||
@@ -1712,7 +1712,7 @@ Map const* WorldObject::GetBaseMap() const
|
||||
|
||||
void WorldObject::AddObjectToRemoveList()
|
||||
{
|
||||
assert(m_uint32Values);
|
||||
ASSERT(m_uint32Values);
|
||||
|
||||
Map* map = FindMap();
|
||||
if (!map)
|
||||
|
||||
@@ -129,7 +129,7 @@ class Object
|
||||
if (m_inWorld)
|
||||
return;
|
||||
|
||||
assert(m_uint32Values);
|
||||
ASSERT(m_uint32Values);
|
||||
|
||||
m_inWorld = true;
|
||||
|
||||
|
||||
@@ -745,7 +745,7 @@ void Pet::GivePetLevel(uint8 level)
|
||||
|
||||
bool Pet::CreateBaseAtCreature(Creature* creature)
|
||||
{
|
||||
assert(creature);
|
||||
ASSERT(creature);
|
||||
|
||||
if (!CreateBaseAtTamed(creature->GetCreatureInfo(), creature->GetMap(), creature->GetPhaseMask()))
|
||||
return false;
|
||||
@@ -819,7 +819,7 @@ bool Pet::CreateBaseAtTamed(CreatureInfo const * cinfo, Map * map, uint32 phaseM
|
||||
bool Guardian::InitStatsForLevel(uint8 petlevel)
|
||||
{
|
||||
CreatureInfo const *cinfo = GetCreatureInfo();
|
||||
assert(cinfo);
|
||||
ASSERT(cinfo);
|
||||
|
||||
SetLevel(petlevel);
|
||||
|
||||
@@ -1877,7 +1877,7 @@ bool Pet::IsPermanentPetFor(Player* owner)
|
||||
|
||||
bool Pet::Create(uint32 guidlow, Map *map, uint32 phaseMask, uint32 Entry, uint32 pet_number)
|
||||
{
|
||||
assert(map);
|
||||
ASSERT(map);
|
||||
SetMap(map);
|
||||
|
||||
SetPhaseMask(phaseMask,false);
|
||||
|
||||
@@ -246,11 +246,11 @@ class Pet : public Guardian
|
||||
private:
|
||||
void SaveToDB(uint32, uint8) // overwrited of Creature::SaveToDB - don't must be called
|
||||
{
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
void DeleteFromDB() // overwrited of Creature::DeleteFromDB - don't must be called
|
||||
{
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -1257,7 +1257,7 @@ void Player::Update(uint32 p_time)
|
||||
|
||||
// If this is set during update SetSpellModTakingSpell call is missing somewhere in the code
|
||||
// Having this would prevent more aura charges to be dropped, so let's crash
|
||||
//assert (!m_spellModTakingSpell);
|
||||
//ASSERT (!m_spellModTakingSpell);
|
||||
if ( m_spellModTakingSpell)
|
||||
{
|
||||
//sLog.outCrash("Player has m_pad %u during update!", m_pad);
|
||||
@@ -1797,7 +1797,7 @@ void Player::TeleportOutOfMap(Map *oldMap)
|
||||
{
|
||||
sLog.outCrash("Cannot teleport player out of map!");
|
||||
ResetMap();
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -4842,7 +4842,7 @@ void Player::CreateCorpse()
|
||||
|
||||
// we don't SaveToDB for players in battlegrounds so don't do it for corpses either
|
||||
const MapEntry *entry = sMapStore.LookupEntry(corpse->GetMapId());
|
||||
assert(entry);
|
||||
ASSERT(entry);
|
||||
if (entry->map_type != MAP_BATTLEGROUND)
|
||||
corpse->SaveToDB();
|
||||
|
||||
@@ -9177,7 +9177,7 @@ void Player::ResetPetTalents()
|
||||
|
||||
void Player::SetVirtualItemSlot(uint8 i, Item* item)
|
||||
{
|
||||
assert(i < 3);
|
||||
ASSERT(i < 3);
|
||||
if (i < 2 && item)
|
||||
{
|
||||
if (!item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
|
||||
@@ -12873,7 +12873,7 @@ void Player::UpdateEnchantTime(uint32 time)
|
||||
{
|
||||
for (EnchantDurationList::iterator itr = m_enchantDuration.begin(),next; itr != m_enchantDuration.end(); itr=next)
|
||||
{
|
||||
assert(itr->item);
|
||||
ASSERT(itr->item);
|
||||
next = itr;
|
||||
if (!itr->item->GetEnchantmentId(itr->slot))
|
||||
{
|
||||
@@ -14251,7 +14251,7 @@ bool Player::CanRewardQuest(Quest const *pQuest, uint32 reward, bool msg)
|
||||
void Player::AddQuest(Quest const *pQuest, Object *questGiver)
|
||||
{
|
||||
uint16 log_slot = FindQuestSlot(0);
|
||||
assert(log_slot < MAX_QUEST_LOG_SIZE);
|
||||
ASSERT(log_slot < MAX_QUEST_LOG_SIZE);
|
||||
|
||||
uint32 quest_id = pQuest->GetQuestId();
|
||||
|
||||
@@ -14677,7 +14677,7 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg)
|
||||
ObjectMgr::ExclusiveQuestGroups::iterator iter2 = objmgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup());
|
||||
ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup());
|
||||
|
||||
assert(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0
|
||||
ASSERT(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0
|
||||
|
||||
for (; iter2 != end; ++iter2)
|
||||
{
|
||||
@@ -14712,7 +14712,7 @@ bool Player::SatisfyQuestPreviousQuest(Quest const* qInfo, bool msg)
|
||||
ObjectMgr::ExclusiveQuestGroups::iterator iter2 = objmgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup());
|
||||
ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qPrevInfo->GetExclusiveGroup());
|
||||
|
||||
assert(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0
|
||||
ASSERT(iter2 != end); // always must be found if qPrevInfo->ExclusiveGroup != 0
|
||||
|
||||
for (; iter2 != end; ++iter2)
|
||||
{
|
||||
@@ -14814,7 +14814,7 @@ bool Player::SatisfyQuestExclusiveGroup(Quest const* qInfo, bool msg)
|
||||
ObjectMgr::ExclusiveQuestGroups::iterator iter = objmgr.mExclusiveQuestGroups.lower_bound(qInfo->GetExclusiveGroup());
|
||||
ObjectMgr::ExclusiveQuestGroups::iterator end = objmgr.mExclusiveQuestGroups.upper_bound(qInfo->GetExclusiveGroup());
|
||||
|
||||
assert(iter != end); // always must be found if qInfo->ExclusiveGroup != 0
|
||||
ASSERT(iter != end); // always must be found if qInfo->ExclusiveGroup != 0
|
||||
|
||||
for (; iter != end; ++iter)
|
||||
{
|
||||
@@ -15687,7 +15687,7 @@ void Player::SendQuestUpdateAddItem(Quest const* /*pQuest*/, uint32 /*item_idx*/
|
||||
|
||||
void Player::SendQuestUpdateAddCreatureOrGo(Quest const* pQuest, uint64 guid, uint32 creatureOrGO_idx, uint32 old_count, uint32 add_count)
|
||||
{
|
||||
assert(old_count + add_count < 65536 && "mob/GO count store in 16 bits 2^16 = 65536 (0..65536)");
|
||||
ASSERT(old_count + add_count < 65536 && "mob/GO count store in 16 bits 2^16 = 65536 (0..65536)");
|
||||
|
||||
int32 entry = pQuest->ReqCreatureOrGOId[ creatureOrGO_idx ];
|
||||
if (entry < 0)
|
||||
@@ -16160,7 +16160,7 @@ bool Player::LoadFromDB(uint32 guid, SqlQueryHolder *holder)
|
||||
TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(node_id);
|
||||
if (nodeEntry && nodeEntry->map_id == GetMapId())
|
||||
{
|
||||
assert(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString
|
||||
ASSERT(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString
|
||||
mapId = nodeEntry->map_id;
|
||||
Relocate(nodeEntry->x, nodeEntry->y, nodeEntry->z,0.0f);
|
||||
}
|
||||
@@ -17440,7 +17440,7 @@ void Player::ConvertInstancesToGroup(Player *player, Group *group, uint64 player
|
||||
if (!group)
|
||||
group = player->GetGroup();
|
||||
}
|
||||
assert(player_guid);
|
||||
ASSERT(player_guid);
|
||||
|
||||
// copy all binds to the group, when changing leader it's assumed the character
|
||||
// will not have any solo binds
|
||||
@@ -18614,7 +18614,7 @@ void Player::StopCastingCharm()
|
||||
if (charm->GetCharmerGUID())
|
||||
{
|
||||
sLog.outCrash("Charmed unit has charmer guid " UI64FMTD, charm->GetCharmerGUID());
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
else
|
||||
SetCharm(charm, false);
|
||||
@@ -19009,7 +19009,7 @@ void Player::RestoreSpellMods(Spell * spell)
|
||||
|
||||
// Skip this check for now - aura charges may change due to various reason
|
||||
// TODO: trac these changes correctly
|
||||
//assert (mod->ownerAura->GetCharges() <= mod->charges);
|
||||
//ASSERT (mod->ownerAura->GetCharges() <= mod->charges);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -20876,7 +20876,7 @@ void Player::SetGroup(Group *group, int8 subgroup)
|
||||
else
|
||||
{
|
||||
// never use SetGroup without a subgroup unless you specify NULL for group
|
||||
assert(subgroup >= 0);
|
||||
ASSERT(subgroup >= 0);
|
||||
m_group.link(group, this);
|
||||
m_group.setSubGroup((uint8)subgroup);
|
||||
}
|
||||
@@ -22146,7 +22146,7 @@ void Player::SetOriginalGroup(Group *group, int8 subgroup)
|
||||
else
|
||||
{
|
||||
// never use SetOriginalGroup without a subgroup unless you specify NULL for group
|
||||
assert(subgroup >= 0);
|
||||
ASSERT(subgroup >= 0);
|
||||
m_originalGroup.link(group, this);
|
||||
m_originalGroup.setSubGroup((uint8)subgroup);
|
||||
}
|
||||
|
||||
@@ -329,7 +329,7 @@ struct EnchantDuration
|
||||
{
|
||||
EnchantDuration() : item(NULL), slot(MAX_ENCHANTMENT_SLOT), leftduration(0) {};
|
||||
EnchantDuration(Item * _item, EnchantmentSlot _slot, uint32 _leftduration) : item(_item), slot(_slot),
|
||||
leftduration(_leftduration){ assert(item); };
|
||||
leftduration(_leftduration){ ASSERT(item); };
|
||||
|
||||
Item * item;
|
||||
EnchantmentSlot slot;
|
||||
@@ -1518,7 +1518,7 @@ class Player : public Unit, public GridObject<Player>
|
||||
void AddMItem(Item* it)
|
||||
{
|
||||
ASSERT(it);
|
||||
//assert deleted, because items can be added before loading
|
||||
//ASSERT deleted, because items can be added before loading
|
||||
mMitems[it->GetGUIDLow()] = it;
|
||||
}
|
||||
|
||||
@@ -2674,7 +2674,7 @@ template <class T> T Player::ApplySpellMod(uint32 spellId, SpellModOp op, T &bas
|
||||
|
||||
// Charges can be set only for mods with auras
|
||||
if (!mod->ownerAura)
|
||||
assert(mod->charges == 0);
|
||||
ASSERT(mod->charges == 0);
|
||||
|
||||
if (!IsAffectedBySpellmod(spellInfo,mod,spell))
|
||||
continue;
|
||||
|
||||
@@ -457,7 +457,7 @@ void Transport::TeleportTransport(uint32 newMapid, float x, float y, float z)
|
||||
ResetMap();
|
||||
Map * newMap = sMapMgr.CreateMap(newMapid, this, 0);
|
||||
SetMap(newMap);
|
||||
assert (GetMap());
|
||||
ASSERT (GetMap());
|
||||
|
||||
if (oldMap != newMap)
|
||||
{
|
||||
|
||||
@@ -206,13 +206,13 @@ Unit::~Unit()
|
||||
delete m_charmInfo;
|
||||
delete m_vehicleKit;
|
||||
|
||||
assert(!m_attacking);
|
||||
assert(m_attackers.empty());
|
||||
assert(m_sharedVision.empty());
|
||||
assert(m_Controlled.empty());
|
||||
assert(m_appliedAuras.empty());
|
||||
assert(m_ownedAuras.empty());
|
||||
assert(m_removedAuras.empty());
|
||||
ASSERT(!m_attacking);
|
||||
ASSERT(m_attackers.empty());
|
||||
ASSERT(m_sharedVision.empty());
|
||||
ASSERT(m_Controlled.empty());
|
||||
ASSERT(m_appliedAuras.empty());
|
||||
ASSERT(m_ownedAuras.empty());
|
||||
ASSERT(m_removedAuras.empty());
|
||||
}
|
||||
|
||||
void Unit::Update(uint32 p_time)
|
||||
@@ -236,7 +236,7 @@ void Unit::Update(uint32 p_time)
|
||||
|
||||
// If this is set during update SetCantProc(false) call is missing somewhere in the code
|
||||
// Having this would prevent spells from being proced, so let's crash
|
||||
assert(!m_procDeep);
|
||||
ASSERT(!m_procDeep);
|
||||
|
||||
if (CanHaveThreatList() && getThreatManager().isNeedUpdateToClient(p_time))
|
||||
SendThreatListUpdate();
|
||||
@@ -812,10 +812,10 @@ uint32 Unit::DealDamage(Unit *pVictim, uint32 damage, CleanDamage const* cleanDa
|
||||
// last damage from duel opponent
|
||||
if (duel_hasEnded)
|
||||
{
|
||||
assert(pVictim->GetTypeId() == TYPEID_PLAYER);
|
||||
ASSERT(pVictim->GetTypeId() == TYPEID_PLAYER);
|
||||
Player *he = (Player*)pVictim;
|
||||
|
||||
assert(he->duel);
|
||||
ASSERT(he->duel);
|
||||
|
||||
he->SetHealth(1);
|
||||
|
||||
@@ -3362,7 +3362,7 @@ void Unit::_UpdateAutoRepeatSpell()
|
||||
|
||||
void Unit::SetCurrentCastedSpell(Spell * pSpell)
|
||||
{
|
||||
assert(pSpell); // NULL may be never passed here, use InterruptSpell or InterruptNonMeleeSpells
|
||||
ASSERT(pSpell); // NULL may be never passed here, use InterruptSpell or InterruptNonMeleeSpells
|
||||
|
||||
CurrentSpellTypes CSpellType = pSpell->GetCurrentContainer();
|
||||
|
||||
@@ -3435,7 +3435,7 @@ void Unit::SetCurrentCastedSpell(Spell * pSpell)
|
||||
|
||||
void Unit::InterruptSpell(CurrentSpellTypes spellType, bool withDelayed, bool withInstant)
|
||||
{
|
||||
assert(spellType < CURRENT_MAX_SPELL);
|
||||
ASSERT(spellType < CURRENT_MAX_SPELL);
|
||||
|
||||
//sLog.outDebug("Interrupt spell for unit %u.", GetEntry());
|
||||
Spell *spell = m_currentSpells[spellType];
|
||||
@@ -3577,7 +3577,7 @@ void Unit::DeMorph()
|
||||
|
||||
void Unit::_AddAura(UnitAura * aura, Unit * caster)
|
||||
{
|
||||
assert(!m_cleanupDone);
|
||||
ASSERT(!m_cleanupDone);
|
||||
m_ownedAuras.insert(AuraMap::value_type(aura->GetId(), aura));
|
||||
|
||||
// passive and Incanter's Absorption and auras with different type can stack with themselves any number of times
|
||||
@@ -3642,9 +3642,9 @@ void Unit::_AddAura(UnitAura * aura, Unit * caster)
|
||||
AuraApplication * Unit::_CreateAuraApplication(Aura * aura, uint8 effMask)
|
||||
{
|
||||
// can't apply aura on unit which is going to be deleted - to not create a memory leak
|
||||
assert(!m_cleanupDone);
|
||||
ASSERT(!m_cleanupDone);
|
||||
// aura musn't be removed
|
||||
assert(!aura->IsRemoved());
|
||||
ASSERT(!aura->IsRemoved());
|
||||
|
||||
SpellEntry const* aurSpellInfo = aura->GetSpellProto();
|
||||
uint32 aurId = aurSpellInfo->Id;
|
||||
@@ -3674,10 +3674,10 @@ AuraApplication * Unit::_CreateAuraApplication(Aura * aura, uint8 effMask)
|
||||
|
||||
void Unit::_ApplyAuraEffect(Aura * aura, uint8 effIndex)
|
||||
{
|
||||
assert(aura);
|
||||
assert(aura->HasEffect(effIndex));
|
||||
ASSERT(aura);
|
||||
ASSERT(aura->HasEffect(effIndex));
|
||||
AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID());
|
||||
assert(aurApp);
|
||||
ASSERT(aurApp);
|
||||
if (!aurApp->GetEffectMask())
|
||||
_ApplyAura(aurApp, 1<<effIndex);
|
||||
else
|
||||
@@ -3725,15 +3725,15 @@ void Unit::_ApplyAura(AuraApplication * aurApp, uint8 effMask)
|
||||
void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMode)
|
||||
{
|
||||
AuraApplication * aurApp = i->second;
|
||||
assert(aurApp);
|
||||
assert(!aurApp->GetRemoveMode());
|
||||
assert(aurApp->GetTarget() == this);
|
||||
ASSERT(aurApp);
|
||||
ASSERT(!aurApp->GetRemoveMode());
|
||||
ASSERT(aurApp->GetTarget() == this);
|
||||
aurApp->SetRemoveMode(removeMode);
|
||||
Aura * aura = aurApp->GetBase();
|
||||
sLog.outDebug("Aura %u now is remove mode %d", aura->GetId(), removeMode);
|
||||
|
||||
// dead loop is killing the server probably
|
||||
assert(m_removedAurasCount < 0xFFFFFFFF);
|
||||
ASSERT(m_removedAurasCount < 0xFFFFFFFF);
|
||||
|
||||
++m_removedAurasCount;
|
||||
|
||||
@@ -3779,7 +3779,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
|
||||
}
|
||||
|
||||
// all effect mustn't be applied
|
||||
assert(!aurApp->GetEffectMask());
|
||||
ASSERT(!aurApp->GetEffectMask());
|
||||
|
||||
// Remove totem at next update if totem looses its aura
|
||||
if (aurApp->GetRemoveMode() == AURA_REMOVE_BY_EXPIRE && GetTypeId() == TYPEID_UNIT && this->ToCreature()->isTotem()&& this->ToTotem()->GetSummonerGUID() == aura->GetCasterGUID())
|
||||
@@ -3802,7 +3802,7 @@ void Unit::_UnapplyAura(AuraApplicationMap::iterator &i, AuraRemoveMode removeMo
|
||||
void Unit::_UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode)
|
||||
{
|
||||
// aura can be removed from unit only if it's applied on it, shouldn't happen
|
||||
assert(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp);
|
||||
ASSERT(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp);
|
||||
uint32 spellId = aurApp->GetBase()->GetId();
|
||||
for (AuraApplicationMap::iterator iter = m_appliedAuras.lower_bound(spellId); iter != m_appliedAuras.upper_bound(spellId);)
|
||||
{
|
||||
@@ -3814,7 +3814,7 @@ void Unit::_UnapplyAura(AuraApplication * aurApp, AuraRemoveMode removeMode)
|
||||
else
|
||||
++iter;
|
||||
}
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
void Unit::_RemoveNoStackAuraApplicationsDueToAura(Aura * aura)
|
||||
@@ -3938,7 +3938,7 @@ void Unit::_HandleAuraEffect(AuraEffect * aurEff, bool apply)
|
||||
void Unit::RemoveOwnedAura(AuraMap::iterator &i, AuraRemoveMode removeMode)
|
||||
{
|
||||
Aura * aura = i->second;
|
||||
assert(!aura->IsRemoved());
|
||||
ASSERT(!aura->IsRemoved());
|
||||
|
||||
// if unit currently update aura list then make safe update iterator shift to next
|
||||
if (m_auraUpdateIterator == i)
|
||||
@@ -3973,7 +3973,7 @@ void Unit::RemoveOwnedAura(Aura * aura, AuraRemoveMode removeMode)
|
||||
if (aura->IsRemoved())
|
||||
return;
|
||||
|
||||
assert(aura->GetOwner() == this);
|
||||
ASSERT(aura->GetOwner() == this);
|
||||
|
||||
uint32 spellId = aura->GetId();
|
||||
for (AuraMap::iterator itr = m_ownedAuras.lower_bound(spellId); itr != m_ownedAuras.upper_bound(spellId); ++itr)
|
||||
@@ -3982,7 +3982,7 @@ void Unit::RemoveOwnedAura(Aura * aura, AuraRemoveMode removeMode)
|
||||
RemoveOwnedAura(itr, removeMode);
|
||||
return;
|
||||
}
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
Aura * Unit::GetOwnedAura(uint32 spellId, uint64 caster, uint8 reqEffMask, Aura * except) const
|
||||
@@ -4024,7 +4024,7 @@ void Unit::RemoveAura(uint32 spellId, uint64 caster, uint8 reqEffMask, AuraRemov
|
||||
|
||||
void Unit::RemoveAura(AuraApplication * aurApp, AuraRemoveMode mode)
|
||||
{
|
||||
assert(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp);
|
||||
ASSERT(aurApp->GetBase()->GetApplicationOfTarget(GetGUID()) == aurApp);
|
||||
// no need to remove
|
||||
if (aurApp->GetRemoveMode() || aurApp->GetBase()->IsRemoved())
|
||||
return;
|
||||
@@ -4048,7 +4048,7 @@ void Unit::RemoveAura(Aura * aura, AuraRemoveMode mode)
|
||||
if (AuraApplication * aurApp = aura->GetApplicationOfTarget(GetGUID()))
|
||||
RemoveAura(aurApp, mode);
|
||||
else
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
void Unit::RemoveAurasDueToSpell(uint32 spellId, uint64 caster, uint8 reqEffMask, AuraRemoveMode removeMode)
|
||||
@@ -9602,14 +9602,14 @@ void Unit::SetMinion(Minion *minion, bool apply)
|
||||
if (GetGUID() == (*itr)->GetCharmerGUID())
|
||||
continue;
|
||||
|
||||
//assert((*itr)->GetOwnerGUID() == GetGUID());
|
||||
//ASSERT((*itr)->GetOwnerGUID() == GetGUID());
|
||||
if ((*itr)->GetOwnerGUID() != GetGUID())
|
||||
{
|
||||
OutDebugInfo();
|
||||
(*itr)->OutDebugInfo();
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
assert((*itr)->GetTypeId() == TYPEID_UNIT);
|
||||
ASSERT((*itr)->GetTypeId() == TYPEID_UNIT);
|
||||
|
||||
if (!(*itr)->HasUnitTypeMask(UNIT_MASK_CONTROLABLE_GUARDIAN))
|
||||
continue;
|
||||
@@ -11765,7 +11765,7 @@ bool Unit::isTargetableForAttack() const
|
||||
|
||||
bool Unit::canAttack(Unit const* target, bool force) const
|
||||
{
|
||||
assert(target);
|
||||
ASSERT(target);
|
||||
|
||||
if (force)
|
||||
{
|
||||
@@ -12364,7 +12364,7 @@ void Unit::DeleteThreatList()
|
||||
|
||||
void Unit::TauntApply(Unit* taunter)
|
||||
{
|
||||
assert(GetTypeId() == TYPEID_UNIT);
|
||||
ASSERT(GetTypeId() == TYPEID_UNIT);
|
||||
|
||||
if (!taunter || (taunter->GetTypeId() == TYPEID_PLAYER && taunter->ToPlayer()->isGameMaster()))
|
||||
return;
|
||||
@@ -12390,7 +12390,7 @@ void Unit::TauntApply(Unit* taunter)
|
||||
|
||||
void Unit::TauntFadeOut(Unit *taunter)
|
||||
{
|
||||
assert(GetTypeId() == TYPEID_UNIT);
|
||||
ASSERT(GetTypeId() == TYPEID_UNIT);
|
||||
|
||||
if (!taunter || (taunter->GetTypeId() == TYPEID_PLAYER && taunter->ToPlayer()->isGameMaster()))
|
||||
return;
|
||||
@@ -13287,7 +13287,7 @@ void Unit::AddToWorld()
|
||||
void Unit::RemoveFromWorld()
|
||||
{
|
||||
// cleanup
|
||||
assert(GetGUID());
|
||||
ASSERT(GetGUID());
|
||||
|
||||
if (IsInWorld())
|
||||
{
|
||||
@@ -13310,7 +13310,7 @@ void Unit::RemoveFromWorld()
|
||||
if (GetCharmerGUID())
|
||||
{
|
||||
sLog.outCrash("Unit %u has charmer guid when removed from world", GetEntry());
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
if (Unit *owner = GetOwner())
|
||||
@@ -13318,7 +13318,7 @@ void Unit::RemoveFromWorld()
|
||||
if (owner->m_Controlled.find(this) != owner->m_Controlled.end())
|
||||
{
|
||||
sLog.outCrash("Unit %u is in controlled list of %u when removed from world", GetEntry(), owner->GetEntry());
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13331,7 +13331,7 @@ void Unit::CleanupsBeforeDelete(bool finalCleanup)
|
||||
if (IsInWorld())
|
||||
RemoveFromWorld();
|
||||
|
||||
assert(GetGUID());
|
||||
ASSERT(GetGUID());
|
||||
|
||||
//A unit may be in removelist and not in world, but it is still in grid
|
||||
//and may have some references during delete
|
||||
@@ -13918,7 +13918,7 @@ void Unit::ProcDamageAndSpellFor(bool isVictim, Unit * pTarget, uint32 procFlag,
|
||||
continue;
|
||||
|
||||
AuraEffect *triggeredByAura = i->aura->GetEffect(effIndex);
|
||||
assert(triggeredByAura);
|
||||
ASSERT(triggeredByAura);
|
||||
|
||||
switch(triggeredByAura->GetAuraType())
|
||||
{
|
||||
@@ -15274,8 +15274,8 @@ bool Unit::SetCharmedBy(Unit* charmer, CharmType type)
|
||||
if (GetTypeId() == TYPEID_PLAYER)
|
||||
Unmount();
|
||||
|
||||
assert(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER);
|
||||
assert((type == CHARM_TYPE_VEHICLE) == IsVehicle());
|
||||
ASSERT(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER);
|
||||
ASSERT((type == CHARM_TYPE_VEHICLE) == IsVehicle());
|
||||
|
||||
sLog.outDebug("SetCharmedBy: charmer %u (GUID %u), charmed %u (GUID %u), type %u.", charmer->GetEntry(), charmer->GetGUIDLow(), GetEntry(), GetGUIDLow(), uint32(type));
|
||||
|
||||
@@ -15411,7 +15411,7 @@ void Unit::RemoveCharmedBy(Unit *charmer)
|
||||
{
|
||||
// sLog.outCrash("Unit::RemoveCharmedBy: this: " UI64FMTD " true charmer: " UI64FMTD " false charmer: " UI64FMTD,
|
||||
// GetGUID(), GetCharmerGUID(), charmer->GetGUID());
|
||||
// assert(false);
|
||||
// ASSERT(false);
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -15464,8 +15464,8 @@ void Unit::RemoveCharmedBy(Unit *charmer)
|
||||
if (!charmer)
|
||||
return;
|
||||
|
||||
assert(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER);
|
||||
assert(type != CHARM_TYPE_VEHICLE || GetTypeId() == TYPEID_UNIT && IsVehicle());
|
||||
ASSERT(type != CHARM_TYPE_POSSESS || charmer->GetTypeId() == TYPEID_PLAYER);
|
||||
ASSERT(type != CHARM_TYPE_VEHICLE || GetTypeId() == TYPEID_UNIT && IsVehicle());
|
||||
|
||||
charmer->SetCharm(this, false);
|
||||
|
||||
@@ -16273,7 +16273,7 @@ void Unit::EnterVehicle(Vehicle *vehicle, int8 seatId)
|
||||
bg->EventPlayerDroppedFlag(this->ToPlayer());
|
||||
}
|
||||
|
||||
assert(!m_vehicle);
|
||||
ASSERT(!m_vehicle);
|
||||
m_vehicle = vehicle;
|
||||
if (!m_vehicle->AddPassenger(this, seatId))
|
||||
{
|
||||
@@ -16309,7 +16309,7 @@ void Unit::ChangeSeat(int8 seatId, bool next)
|
||||
|
||||
m_vehicle->RemovePassenger(this);
|
||||
if (!m_vehicle->AddPassenger(this, seatId))
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
void Unit::ExitVehicle()
|
||||
|
||||
@@ -1913,7 +1913,7 @@ class Unit : public WorldObject
|
||||
++m_procDeep;
|
||||
else
|
||||
{
|
||||
assert(m_procDeep);
|
||||
ASSERT(m_procDeep);
|
||||
--m_procDeep;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -61,13 +61,13 @@ Vehicle::Vehicle(Unit *unit, VehicleEntry const *vehInfo) : me(unit), m_vehicleI
|
||||
default:
|
||||
break;
|
||||
}
|
||||
assert(!m_Seats.empty());
|
||||
ASSERT(!m_Seats.empty());
|
||||
}
|
||||
|
||||
Vehicle::~Vehicle()
|
||||
{
|
||||
for (SeatMap::const_iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr)
|
||||
assert(!itr->second.passenger);
|
||||
ASSERT(!itr->second.passenger);
|
||||
}
|
||||
|
||||
void Vehicle::Install()
|
||||
@@ -171,7 +171,7 @@ void Vehicle::RemoveAllPassengers()
|
||||
if (itr->second.passenger)
|
||||
{
|
||||
sLog.outCrash("Vehicle %u cannot remove passenger %u. %u is still on vehicle.", me->GetEntry(), passenger->GetEntry(), itr->second.passenger->GetEntry());
|
||||
//assert(!itr->second.passenger);
|
||||
//ASSERT(!itr->second.passenger);
|
||||
itr->second.passenger = NULL;
|
||||
}
|
||||
}
|
||||
@@ -222,7 +222,7 @@ void Vehicle::InstallAccessory(uint32 entry, int8 seatId, bool minion)
|
||||
// already installed
|
||||
if (passenger->GetEntry() == entry)
|
||||
{
|
||||
assert(passenger->GetTypeId() == TYPEID_UNIT);
|
||||
ASSERT(passenger->GetTypeId() == TYPEID_UNIT);
|
||||
if (me->GetTypeId() == TYPEID_UNIT && me->ToCreature()->IsInEvadeMode() && passenger->ToCreature()->IsAIEnabled)
|
||||
passenger->ToCreature()->AI()->EnterEvadeMode();
|
||||
return;
|
||||
@@ -265,7 +265,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
|
||||
if (seat->second.passenger)
|
||||
seat->second.passenger->ExitVehicle();
|
||||
|
||||
assert(!seat->second.passenger);
|
||||
ASSERT(!seat->second.passenger);
|
||||
}
|
||||
|
||||
sLog.outDebug("Unit %s enter vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first);
|
||||
@@ -273,7 +273,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
|
||||
seat->second.passenger = unit;
|
||||
if (seat->second.seatInfo->IsUsable())
|
||||
{
|
||||
assert(m_usableSeatNum);
|
||||
ASSERT(m_usableSeatNum);
|
||||
--m_usableSeatNum;
|
||||
if (!m_usableSeatNum)
|
||||
{
|
||||
@@ -302,7 +302,7 @@ bool Vehicle::AddPassenger(Unit *unit, int8 seatId)
|
||||
&& unit->GetTypeId() == TYPEID_PLAYER
|
||||
&& seat->first == 0 && seat->second.seatInfo->m_flags & 0x800) // not right
|
||||
if (!me->SetCharmedBy(unit, CHARM_TYPE_VEHICLE))
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
|
||||
if (me->IsInWorld())
|
||||
{
|
||||
@@ -335,7 +335,7 @@ void Vehicle::RemovePassenger(Unit *unit)
|
||||
if (seat->second.passenger == unit)
|
||||
break;
|
||||
|
||||
assert(seat != m_Seats.end());
|
||||
ASSERT(seat != m_Seats.end());
|
||||
|
||||
sLog.outDebug("Unit %s exit vehicle entry %u id %u dbguid %u seat %d", unit->GetName(), me->GetEntry(), m_vehicleInfo->m_ID, me->GetGUIDLow(), (int32)seat->first);
|
||||
|
||||
@@ -372,7 +372,7 @@ void Vehicle::RemovePassenger(Unit *unit)
|
||||
void Vehicle::RelocatePassengers(float x, float y, float z, float ang)
|
||||
{
|
||||
Map *map = me->GetMap();
|
||||
assert(map != NULL);
|
||||
ASSERT(map != NULL);
|
||||
|
||||
// not sure that absolute position calculation is correct, it must depend on vehicle orientation and pitch angle
|
||||
for (SeatMap::const_iterator itr = m_Seats.begin(); itr != m_Seats.end(); ++itr)
|
||||
|
||||
Reference in New Issue
Block a user