Fix some memory leaks

--HG--
branch : trunk
This commit is contained in:
silverice
2010-06-11 05:00:46 +03:00
parent d9d6e5732d
commit d6d9d50952
2 changed files with 10 additions and 10 deletions

View File

@@ -1331,12 +1331,12 @@ void CreatureEventAI::ReceiveEmote(Player* pPlayer, uint32 text_emote)
if ((*itr).Event.receive_emote.emoteId != text_emote)
return;
Condition* cond = new Condition();
cond->mConditionType = ConditionType((*itr).Event.receive_emote.condition);
cond->mConditionValue1 = (*itr).Event.receive_emote.conditionValue1;
cond->mConditionValue2 = (*itr).Event.receive_emote.conditionValue2;
Condition cond;
cond.mConditionType = ConditionType((*itr).Event.receive_emote.condition);
cond.mConditionValue1 = (*itr).Event.receive_emote.conditionValue1;
cond.mConditionValue2 = (*itr).Event.receive_emote.conditionValue2;
if (cond->Meets(pPlayer))
if (cond.Meets(pPlayer))
{
sLog.outDebug("CreatureEventAI: ReceiveEmote CreatureEventAI: Condition ok, processing");
ProcessEvent(*itr, pPlayer);

View File

@@ -362,11 +362,11 @@ void CreatureEventAIMgr::LoadCreatureEventAI_Scripts()
}
if (temp.receive_emote.condition)
{
Condition* cond = new Condition();
cond->mConditionType = ConditionType(temp.receive_emote.condition);
cond->mConditionValue1 = temp.receive_emote.conditionValue1;
cond->mConditionValue2 = temp.receive_emote.conditionValue2;
if (!sConditionMgr.isConditionTypeValid(cond))
Condition cond;
cond.mConditionType = ConditionType(temp.receive_emote.condition);
cond.mConditionValue1 = temp.receive_emote.conditionValue1;
cond.mConditionValue2 = temp.receive_emote.conditionValue2;
if (!sConditionMgr.isConditionTypeValid(&cond))
{
sLog.outErrorDb("CreatureEventAI: Creature %u using event %u: param2 (Condition: %u) are not valid.",temp.creature_id, i, temp.receive_emote.condition);
continue;