mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-21 17:54:48 +01:00
Fix some memory leaks
--HG-- branch : trunk
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user