Core/Scripts: Fixed uninitialized variable and memory leaks

This commit is contained in:
Shauren
2013-08-26 17:38:02 +02:00
parent 664ed816df
commit 4f44cdf2b5
4 changed files with 26 additions and 15 deletions

View File

@@ -364,10 +364,8 @@ public:
me->GetRandomNearPosition(pos, 60);
else
{
std::vector<InfernalPoint*>::iterator itr = positions.begin()+rand()%positions.size();
point = *itr;
positions.erase(itr);
pos.Relocate(point->x, point->y, INFERNAL_Z, 0.0f);
point = Trinity::Containers::SelectRandomContainerElement(positions);
pos.Relocate(point->x, point->y, INFERNAL_Z, frand(0.0f, float(M_PI * 2)));
}
Creature* infernal = me->SummonCreature(NETHERSPITE_INFERNAL, pos, TEMPSUMMON_TIMED_DESPAWN, 180000);

View File

@@ -493,7 +493,7 @@ class npc_green_dragon_combat_trigger : public CreatureScript
struct npc_green_dragon_combat_triggerAI : public BossAI
{
npc_green_dragon_combat_triggerAI(Creature* creature) : BossAI(creature, DATA_VALITHRIA_DREAMWALKER)
npc_green_dragon_combat_triggerAI(Creature* creature) : BossAI(creature, DATA_VALITHRIA_DREAMWALKER), _evadeCheck(false)
{
}