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:
Anubisss
2010-04-01 19:09:56 +02:00
parent 9f544d2f93
commit f78b766705
10 changed files with 16 additions and 15 deletions
+1 -1
View File
@@ -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();
}