forked from mirror/azerothcore-wotlk
chore(Core/Condition): replace assertion with logs preventing server crash (#7730)
This commit is contained in:
@@ -4,15 +4,15 @@
|
||||
* Copyright (C) 2005-2009 MaNGOS <http://getmangos.com/>
|
||||
*/
|
||||
|
||||
#include "AchievementMgr.h"
|
||||
#include "ConditionMgr.h"
|
||||
#include "AchievementMgr.h"
|
||||
#include "GameEventMgr.h"
|
||||
#include "InstanceScript.h"
|
||||
#include "ObjectMgr.h"
|
||||
#include "Player.h"
|
||||
#include "ReputationMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "ScriptMgr.h"
|
||||
#include "ScriptedCreature.h"
|
||||
#include "Spell.h"
|
||||
#include "SpellAuras.h"
|
||||
#include "SpellMgr.h"
|
||||
@@ -21,7 +21,13 @@
|
||||
// Can have CONDITION_SOURCE_TYPE_NONE && !mReferenceId if called from a special event (ie: eventAI)
|
||||
bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
{
|
||||
ASSERT(ConditionTarget < MAX_CONDITION_TARGETS);
|
||||
// ASSERT(ConditionTarget < MAX_CONDITION_TARGETS);
|
||||
if (ConditionTarget >= MAX_CONDITION_TARGETS)
|
||||
{
|
||||
LOG_ERROR("condition", "ConditionTarget %d for for condition (Entry: %u Type: %u Group: %u) is greater or equal than MAX_CONDITION_TARGETS", ConditionTarget, SourceEntry, SourceType, SourceGroup);
|
||||
return false;
|
||||
}
|
||||
|
||||
WorldObject* object = sourceInfo.mConditionTargets[ConditionTarget];
|
||||
// object not present, return false
|
||||
if (!object)
|
||||
@@ -203,12 +209,12 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
case CONDITION_DRUNKENSTATE:
|
||||
{
|
||||
if (Player* player = object->ToPlayer())
|
||||
condMeets = (uint32)Player::GetDrunkenstateByValue(player->GetDrunkValue()) >= ConditionValue1;
|
||||
condMeets = (uint32) Player::GetDrunkenstateByValue(player->GetDrunkValue()) >= ConditionValue1;
|
||||
break;
|
||||
}
|
||||
case CONDITION_NEAR_CREATURE:
|
||||
{
|
||||
condMeets = static_cast<bool>(GetClosestCreatureWithEntry(object, ConditionValue1, static_cast<float>(ConditionValue2),!ConditionValue3));
|
||||
condMeets = static_cast<bool>(GetClosestCreatureWithEntry(object, ConditionValue1, static_cast<float>(ConditionValue2), !ConditionValue3));
|
||||
break;
|
||||
}
|
||||
case CONDITION_NEAR_GAMEOBJECT:
|
||||
@@ -367,13 +373,8 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
if (Player* player = object->ToPlayer())
|
||||
{
|
||||
uint32 queststateConditionValue1 = player->GetQuestStatus(ConditionValue1);
|
||||
if (
|
||||
((ConditionValue2 & (1 << QUEST_STATUS_NONE)) && (queststateConditionValue1 == QUEST_STATUS_NONE)) ||
|
||||
((ConditionValue2 & (1 << QUEST_STATUS_COMPLETE)) && (queststateConditionValue1 == QUEST_STATUS_COMPLETE)) ||
|
||||
((ConditionValue2 & (1 << QUEST_STATUS_INCOMPLETE)) && (queststateConditionValue1 == QUEST_STATUS_INCOMPLETE)) ||
|
||||
((ConditionValue2 & (1 << QUEST_STATUS_FAILED)) && (queststateConditionValue1 == QUEST_STATUS_FAILED)) ||
|
||||
((ConditionValue2 & (1 << QUEST_STATUS_REWARDED)) && player->GetQuestRewardStatus(ConditionValue1))
|
||||
)
|
||||
if (((ConditionValue2 & (1 << QUEST_STATUS_NONE)) && (queststateConditionValue1 == QUEST_STATUS_NONE)) || ((ConditionValue2 & (1 << QUEST_STATUS_COMPLETE)) && (queststateConditionValue1 == QUEST_STATUS_COMPLETE)) || ((ConditionValue2 & (1 << QUEST_STATUS_INCOMPLETE)) && (queststateConditionValue1 == QUEST_STATUS_INCOMPLETE)) || ((ConditionValue2 & (1 << QUEST_STATUS_FAILED)) && (queststateConditionValue1 == QUEST_STATUS_FAILED)) ||
|
||||
((ConditionValue2 & (1 << QUEST_STATUS_REWARDED)) && player->GetQuestRewardStatus(ConditionValue1)))
|
||||
{
|
||||
condMeets = true;
|
||||
}
|
||||
@@ -418,8 +419,8 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo)
|
||||
if (!condMeets)
|
||||
sourceInfo.mLastFailedCondition = this;
|
||||
|
||||
//bool script = sScriptMgr->OnConditionCheck(this, sourceInfo); // Returns true by default. // pussywizard: optimization
|
||||
return condMeets;// && script;
|
||||
// bool script = sScriptMgr->OnConditionCheck(this, sourceInfo); // Returns true by default. // pussywizard: optimization
|
||||
return condMeets; // && script;
|
||||
}
|
||||
|
||||
uint32 Condition::GetSearcherTypeMaskForCondition()
|
||||
@@ -602,7 +603,7 @@ uint32 Condition::GetSearcherTypeMaskForCondition()
|
||||
uint32 Condition::GetMaxAvailableConditionTargets()
|
||||
{
|
||||
// returns number of targets which are available for given source type
|
||||
switch(SourceType)
|
||||
switch (SourceType)
|
||||
{
|
||||
case CONDITION_SOURCE_TYPE_SMART_EVENT:
|
||||
return 3;
|
||||
@@ -621,9 +622,7 @@ uint32 Condition::GetMaxAvailableConditionTargets()
|
||||
}
|
||||
}
|
||||
|
||||
ConditionMgr::ConditionMgr()
|
||||
{
|
||||
}
|
||||
ConditionMgr::ConditionMgr() {}
|
||||
|
||||
ConditionMgr::~ConditionMgr()
|
||||
{
|
||||
@@ -679,8 +678,7 @@ uint32 ConditionMgr::GetSearcherTypeMaskForConditionList(ConditionList const& co
|
||||
// object will match condition when one of the checks in ElseGroupStore is matching
|
||||
// so, let's include all possible masks
|
||||
uint32 mask = 0;
|
||||
for (std::map<uint32, uint32>::const_iterator i = ElseGroupStore.begin(); i != ElseGroupStore.end(); ++i)
|
||||
mask |= i->second;
|
||||
for (std::map<uint32, uint32>::const_iterator i = ElseGroupStore.begin(); i != ElseGroupStore.end(); ++i) mask |= i->second;
|
||||
|
||||
return mask;
|
||||
}
|
||||
@@ -702,7 +700,7 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo,
|
||||
else if (!(*itr).second)
|
||||
continue;
|
||||
|
||||
if ((*i)->ReferenceId)//handle reference
|
||||
if ((*i)->ReferenceId) // handle reference
|
||||
{
|
||||
ConditionReferenceContainer::const_iterator ref = ConditionReferenceStore.find((*i)->ReferenceId);
|
||||
if (ref != ConditionReferenceStore.end())
|
||||
@@ -715,7 +713,7 @@ bool ConditionMgr::IsObjectMeetToConditionList(ConditionSourceInfo& sourceInfo,
|
||||
LOG_DEBUG("condition", "IsPlayerMeetToConditionList: Reference template -%u not found", (*i)->ReferenceId);
|
||||
}
|
||||
}
|
||||
else //handle normal condition
|
||||
else // handle normal condition
|
||||
{
|
||||
if (!(*i)->Meets(sourceInfo))
|
||||
ElseGroupStore[(*i)->ElseGroup] = false;
|
||||
@@ -752,25 +750,9 @@ bool ConditionMgr::IsObjectMeetToConditions(ConditionSourceInfo& sourceInfo, Con
|
||||
|
||||
bool ConditionMgr::CanHaveSourceGroupSet(ConditionSourceType sourceType) const
|
||||
{
|
||||
return (sourceType == CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_VEHICLE_SPELL ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_SMART_EVENT ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_NPC_VENDOR);
|
||||
return (sourceType == CONDITION_SOURCE_TYPE_CREATURE_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_DISENCHANT_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_FISHING_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_GAMEOBJECT_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_ITEM_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_MAIL_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_MILLING_LOOT_TEMPLATE ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_PICKPOCKETING_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_PROSPECTING_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_REFERENCE_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_SKINNING_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_SPELL_LOOT_TEMPLATE || sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU || sourceType == CONDITION_SOURCE_TYPE_GOSSIP_MENU_OPTION || sourceType == CONDITION_SOURCE_TYPE_VEHICLE_SPELL ||
|
||||
sourceType == CONDITION_SOURCE_TYPE_SPELL_IMPLICIT_TARGET || sourceType == CONDITION_SOURCE_TYPE_SPELL_CLICK_EVENT || sourceType == CONDITION_SOURCE_TYPE_SMART_EVENT || sourceType == CONDITION_SOURCE_TYPE_NPC_VENDOR);
|
||||
}
|
||||
|
||||
bool ConditionMgr::CanHaveSourceIdSet(ConditionSourceType sourceType) const
|
||||
@@ -867,7 +849,7 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
|
||||
Clean();
|
||||
|
||||
//must clear all custom handled cases (groupped types) before reload
|
||||
// must clear all custom handled cases (groupped types) before reload
|
||||
if (isReload)
|
||||
{
|
||||
LOG_INFO("server.loading", "Reseting Loot Conditions...");
|
||||
@@ -929,9 +911,9 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
if (iSourceTypeOrReferenceId >= 0)
|
||||
cond->SourceType = ConditionSourceType(iSourceTypeOrReferenceId);
|
||||
|
||||
if (iConditionTypeOrReference < 0)//it has a reference
|
||||
if (iConditionTypeOrReference < 0) // it has a reference
|
||||
{
|
||||
if (iConditionTypeOrReference == iSourceTypeOrReferenceId)//self referencing, skip
|
||||
if (iConditionTypeOrReference == iSourceTypeOrReferenceId) // self referencing, skip
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Condition reference %i is referencing self, skipped", iSourceTypeOrReferenceId);
|
||||
delete cond;
|
||||
@@ -942,7 +924,7 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
const char* rowType = "reference template";
|
||||
if (iSourceTypeOrReferenceId >= 0)
|
||||
rowType = "reference";
|
||||
//check for useless data
|
||||
// check for useless data
|
||||
if (cond->ConditionTarget)
|
||||
LOG_ERROR("sql.sql", "Condition %s %i has useless data in ConditionTarget (%u)!", rowType, iSourceTypeOrReferenceId, cond->ConditionTarget);
|
||||
if (cond->ConditionValue1)
|
||||
@@ -958,33 +940,33 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
if (cond->SourceEntry && iSourceTypeOrReferenceId < 0)
|
||||
LOG_ERROR("sql.sql", "Condition %s %i has useless data in SourceEntry (%u)!", rowType, iSourceTypeOrReferenceId, cond->SourceEntry);
|
||||
}
|
||||
else if (!isConditionTypeValid(cond))//doesn't have reference, validate ConditionType
|
||||
else if (!isConditionTypeValid(cond)) // doesn't have reference, validate ConditionType
|
||||
{
|
||||
delete cond;
|
||||
continue;
|
||||
}
|
||||
|
||||
if (iSourceTypeOrReferenceId < 0)//it is a reference template
|
||||
if (iSourceTypeOrReferenceId < 0) // it is a reference template
|
||||
{
|
||||
uint32 uRefId = abs(iSourceTypeOrReferenceId);
|
||||
if (ConditionReferenceStore.find(uRefId) == ConditionReferenceStore.end())//make sure we have a list for our conditions, based on reference id
|
||||
if (ConditionReferenceStore.find(uRefId) == ConditionReferenceStore.end()) // make sure we have a list for our conditions, based on reference id
|
||||
{
|
||||
ConditionList mCondList;
|
||||
ConditionReferenceStore[uRefId] = mCondList;
|
||||
}
|
||||
ConditionReferenceStore[uRefId].push_back(cond);//add to reference storage
|
||||
ConditionReferenceStore[uRefId].push_back(cond); // add to reference storage
|
||||
count++;
|
||||
continue;
|
||||
}//end of reference templates
|
||||
} // end of reference templates
|
||||
|
||||
//if not a reference and SourceType is invalid, skip
|
||||
// if not a reference and SourceType is invalid, skip
|
||||
if (iConditionTypeOrReference >= 0 && !isSourceTypeValid(cond))
|
||||
{
|
||||
delete cond;
|
||||
continue;
|
||||
}
|
||||
|
||||
//Grouping is only allowed for some types (loot templates, gossip menus, gossip items)
|
||||
// Grouping is only allowed for some types (loot templates, gossip menus, gossip items)
|
||||
if (cond->SourceGroup && !CanHaveSourceGroupSet(cond->SourceType))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "Condition type %u has not allowed value of SourceGroup = %u!", uint32(cond->SourceType), cond->SourceGroup);
|
||||
@@ -1108,22 +1090,22 @@ void ConditionMgr::LoadConditions(bool isReload)
|
||||
continue;
|
||||
}
|
||||
|
||||
//handle not grouped conditions
|
||||
//make sure we have a storage list for our SourceType
|
||||
// handle not grouped conditions
|
||||
// make sure we have a storage list for our SourceType
|
||||
if (ConditionStore.find(cond->SourceType) == ConditionStore.end())
|
||||
{
|
||||
ConditionTypeContainer mTypeMap;
|
||||
ConditionStore[cond->SourceType] = mTypeMap;//add new empty list for SourceType
|
||||
ConditionStore[cond->SourceType] = mTypeMap; // add new empty list for SourceType
|
||||
}
|
||||
|
||||
//make sure we have a condition list for our SourceType's entry
|
||||
// make sure we have a condition list for our SourceType's entry
|
||||
if (ConditionStore[cond->SourceType].find(cond->SourceEntry) == ConditionStore[cond->SourceType].end())
|
||||
{
|
||||
ConditionList mCondList;
|
||||
ConditionStore[cond->SourceType][cond->SourceEntry] = mCondList;
|
||||
}
|
||||
|
||||
//add new Condition to storage based on Type/Entry
|
||||
// add new Condition to storage based on Type/Entry
|
||||
ConditionStore[cond->SourceType][cond->SourceEntry].push_back(cond);
|
||||
++count;
|
||||
} while (result->NextRow());
|
||||
@@ -1239,8 +1221,10 @@ bool ConditionMgr::addToSpellImplicitTargetConditions(Condition* cond)
|
||||
// we have overlapping masks in db
|
||||
if (conditionEffMask != *itr)
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set - "
|
||||
"effect masks are overlapping (all SourceGroup values having given bit set must be equal) - ignoring.", cond->SourceEntry, cond->SourceGroup);
|
||||
LOG_ERROR("sql.sql",
|
||||
"SourceEntry %u in `condition` table, has incorrect SourceGroup %u (spell effectMask) set - "
|
||||
"effect masks are overlapping (all SourceGroup values having given bit set must be equal) - ignoring.",
|
||||
cond->SourceEntry, cond->SourceGroup);
|
||||
return false;
|
||||
}
|
||||
}
|
||||
@@ -1618,28 +1602,22 @@ bool ConditionMgr::isSourceTypeValid(Condition* cond)
|
||||
}
|
||||
bool ConditionMgr::isConditionTypeValid(Condition* cond)
|
||||
{
|
||||
if (cond->ConditionType == CONDITION_NONE
|
||||
|| (cond->ConditionType >= CONDITION_TC_END && cond->ConditionType <= CONDITION_AC_START)
|
||||
|| (cond->ConditionType >= CONDITION_AC_END)
|
||||
)
|
||||
if (cond->ConditionType == CONDITION_NONE || (cond->ConditionType >= CONDITION_TC_END && cond->ConditionType <= CONDITION_AC_START) || (cond->ConditionType >= CONDITION_AC_END))
|
||||
{
|
||||
LOG_ERROR("sql.sql", "SourceEntry %u in `condition` table has an invalid ConditionType (%u), ignoring.",
|
||||
cond->SourceEntry, uint32(cond->ConditionType));
|
||||
LOG_ERROR("sql.sql", "SourceEntry %u in `condition` table has an invalid ConditionType (%u), ignoring.", cond->SourceEntry, uint32(cond->ConditionType));
|
||||
return false;
|
||||
}
|
||||
switch (cond->ConditionType)
|
||||
{
|
||||
case CONDITION_TERRAIN_SWAP:
|
||||
case CONDITION_DIFFICULTY_ID:
|
||||
LOG_ERROR("sql.sql", "SourceEntry %u in `condition` table has a ConditionType that is not supported on 3.3.5a (%u), ignoring.",
|
||||
cond->SourceEntry, uint32(cond->ConditionType));
|
||||
LOG_ERROR("sql.sql", "SourceEntry %u in `condition` table has a ConditionType that is not supported on 3.3.5a (%u), ignoring.", cond->SourceEntry, uint32(cond->ConditionType));
|
||||
return false;
|
||||
case CONDITION_STAND_STATE:
|
||||
case CONDITION_CHARMED:
|
||||
case CONDITION_PET_TYPE:
|
||||
case CONDITION_TAXI:
|
||||
LOG_ERROR("sql.sql", "SourceEntry %u in `condition` table has a ConditionType that is not yet supported on AzerothCore (%u), ignoring.",
|
||||
cond->SourceEntry, uint32(cond->ConditionType));
|
||||
LOG_ERROR("sql.sql", "SourceEntry %u in `condition` table has a ConditionType that is not yet supported on AzerothCore (%u), ignoring.", cond->SourceEntry, uint32(cond->ConditionType));
|
||||
return false;
|
||||
default:
|
||||
break;
|
||||
@@ -2236,8 +2214,7 @@ void ConditionMgr::Clean()
|
||||
{
|
||||
for (ConditionReferenceContainer::iterator itr = ConditionReferenceStore.begin(); itr != ConditionReferenceStore.end(); ++itr)
|
||||
{
|
||||
for (ConditionList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it)
|
||||
delete *it;
|
||||
for (ConditionList::const_iterator it = itr->second.begin(); it != itr->second.end(); ++it) delete *it;
|
||||
itr->second.clear();
|
||||
}
|
||||
|
||||
@@ -2247,8 +2224,7 @@ void ConditionMgr::Clean()
|
||||
{
|
||||
for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
|
||||
{
|
||||
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
|
||||
delete *i;
|
||||
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) delete *i;
|
||||
it->second.clear();
|
||||
}
|
||||
itr->second.clear();
|
||||
@@ -2260,8 +2236,7 @@ void ConditionMgr::Clean()
|
||||
{
|
||||
for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
|
||||
{
|
||||
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
|
||||
delete *i;
|
||||
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) delete *i;
|
||||
it->second.clear();
|
||||
}
|
||||
itr->second.clear();
|
||||
@@ -2273,8 +2248,7 @@ void ConditionMgr::Clean()
|
||||
{
|
||||
for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
|
||||
{
|
||||
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
|
||||
delete *i;
|
||||
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) delete *i;
|
||||
it->second.clear();
|
||||
}
|
||||
itr->second.clear();
|
||||
@@ -2286,8 +2260,7 @@ void ConditionMgr::Clean()
|
||||
{
|
||||
for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
|
||||
{
|
||||
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
|
||||
delete *i;
|
||||
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) delete *i;
|
||||
it->second.clear();
|
||||
}
|
||||
itr->second.clear();
|
||||
@@ -2299,8 +2272,7 @@ void ConditionMgr::Clean()
|
||||
{
|
||||
for (ConditionTypeContainer::iterator it = itr->second.begin(); it != itr->second.end(); ++it)
|
||||
{
|
||||
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i)
|
||||
delete *i;
|
||||
for (ConditionList::const_iterator i = it->second.begin(); i != it->second.end(); ++i) delete *i;
|
||||
it->second.clear();
|
||||
}
|
||||
itr->second.clear();
|
||||
@@ -2309,8 +2281,7 @@ void ConditionMgr::Clean()
|
||||
NpcVendorConditionContainerStore.clear();
|
||||
|
||||
// this is a BIG hack, feel free to fix it if you can figure out the ConditionMgr ;)
|
||||
for (std::list<Condition*>::const_iterator itr = AllocatedMemoryStore.begin(); itr != AllocatedMemoryStore.end(); ++itr)
|
||||
delete *itr;
|
||||
for (std::list<Condition*>::const_iterator itr = AllocatedMemoryStore.begin(); itr != AllocatedMemoryStore.end(); ++itr) delete *itr;
|
||||
|
||||
AllocatedMemoryStore.clear();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user