Use ToTempSummon() in a case instead of a C style cast.
Use correct Unit::GetCreature() instead of Unit::GetUnit() with casting the object to Creature pointer. Remove some usless casts. Fix a possible crash in pyrewood_ambushAI. TODO: Remove ugly cast macros(like CAST_PLR(), CAST_CRE()) from scripts and use the correct ToX() functions(like ToPlayer(), ToCreature()). --HG-- branch : trunk
This commit is contained in:
@@ -277,7 +277,7 @@ struct npc_gurgthockAI : public ScriptedAI
|
||||
|
||||
for(std::list<uint64>::iterator itr = SummonList.begin(); itr != SummonList.end(); ++itr)
|
||||
{
|
||||
if (Creature* pTemp = (Creature*)Unit::GetUnit(*m_creature, *itr))
|
||||
if (Creature* pTemp = Unit::GetCreature(*m_creature, *itr))
|
||||
if (pTemp)
|
||||
pTemp->RemoveFromWorld();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user