mirror of
https://github.com/mangosfour/server.git
synced 2025-12-15 01:37:00 +00:00
[9638] Replace all C assert()s with MaNGOS ASSERT() macro.
This commit is contained in:
parent
4443737005
commit
51fd11c92c
34 changed files with 121 additions and 121 deletions
|
|
@ -4162,7 +4162,7 @@ void Player::BuildPlayerRepop()
|
|||
if(GetCorpse())
|
||||
{
|
||||
sLog.outError("BuildPlayerRepop: player %s(%d) already has a corpse", GetName(), GetGUIDLow());
|
||||
assert(false);
|
||||
ASSERT(false);
|
||||
}
|
||||
|
||||
// create a corpse and place it at the player's location
|
||||
|
|
@ -4356,7 +4356,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();
|
||||
|
||||
|
|
@ -8255,7 +8255,7 @@ void Player::SendPetSkillWipeConfirm()
|
|||
|
||||
void Player::SetVirtualItemSlot( uint8 i, Item* item)
|
||||
{
|
||||
assert(i < 3);
|
||||
ASSERT(i < 3);
|
||||
if(i < 2 && item)
|
||||
{
|
||||
if(!item->GetEnchantmentId(TEMP_ENCHANTMENT_SLOT))
|
||||
|
|
@ -11872,7 +11872,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))
|
||||
{
|
||||
|
|
@ -13146,7 +13146,7 @@ void Player::SendPetTameFailure(PetTameFailureReason reason)
|
|||
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();
|
||||
|
||||
|
|
@ -13535,7 +13535,7 @@ bool Player::SatisfyQuestPreviousQuest( Quest const* qInfo, bool msg )
|
|||
ObjectMgr::ExclusiveQuestGroups::const_iterator iter2 = sObjectMgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup());
|
||||
ObjectMgr::ExclusiveQuestGroups::const_iterator end = sObjectMgr.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)
|
||||
{
|
||||
|
|
@ -13570,7 +13570,7 @@ bool Player::SatisfyQuestPreviousQuest( Quest const* qInfo, bool msg )
|
|||
ObjectMgr::ExclusiveQuestGroups::const_iterator iter2 = sObjectMgr.mExclusiveQuestGroups.lower_bound(qPrevInfo->GetExclusiveGroup());
|
||||
ObjectMgr::ExclusiveQuestGroups::const_iterator end = sObjectMgr.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)
|
||||
{
|
||||
|
|
@ -13673,7 +13673,7 @@ bool Player::SatisfyQuestExclusiveGroup( Quest const* qInfo, bool msg )
|
|||
ObjectMgr::ExclusiveQuestGroups::const_iterator iter = sObjectMgr.mExclusiveQuestGroups.lower_bound(qInfo->GetExclusiveGroup());
|
||||
ObjectMgr::ExclusiveQuestGroups::const_iterator end = sObjectMgr.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)
|
||||
{
|
||||
|
|
@ -14483,7 +14483,7 @@ void Player::SendQuestUpdateAddItem( Quest const* /*pQuest*/, uint32 /*item_idx*
|
|||
|
||||
void Player::SendQuestUpdateAddCreatureOrGo( Quest const* pQuest, ObjectGuid 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)
|
||||
|
|
@ -15146,7 +15146,7 @@ bool Player::LoadFromDB( uint32 guid, SqlQueryHolder *holder )
|
|||
{
|
||||
// save source node as recall coord to prevent recall and fall from sky
|
||||
TaxiNodesEntry const* nodeEntry = sTaxiNodesStore.LookupEntry(node_id);
|
||||
assert(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString
|
||||
ASSERT(nodeEntry); // checked in m_taxi.LoadTaxiDestinationsFromString
|
||||
m_recallMap = nodeEntry->map_id;
|
||||
m_recallX = nodeEntry->x;
|
||||
m_recallY = nodeEntry->y;
|
||||
|
|
@ -16109,7 +16109,7 @@ void Player::ConvertInstancesToGroup(Player *player, Group *group, uint64 player
|
|||
bool has_solo = false;
|
||||
|
||||
if(player) { player_guid = player->GetGUID(); 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
|
||||
|
|
@ -16200,7 +16200,7 @@ bool Player::_LoadHomeBind(QueryResult *result)
|
|||
|
||||
void Player::SaveToDB()
|
||||
{
|
||||
// we should assure this: assert((m_nextSave != sWorld.getConfig(CONFIG_UINT32_INTERVAL_SAVE)));
|
||||
// we should assure this: ASSERT((m_nextSave != sWorld.getConfig(CONFIG_UINT32_INTERVAL_SAVE)));
|
||||
// delay auto save at any saves (manual, in code, or autosave)
|
||||
m_nextSave = sWorld.getConfig(CONFIG_UINT32_INTERVAL_SAVE);
|
||||
|
||||
|
|
@ -18915,7 +18915,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);
|
||||
}
|
||||
|
|
@ -20083,7 +20083,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);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue