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
@@ -723,7 +723,7 @@ struct mob_palehoof_orbAI : public ScriptedAI
{
pNext->RemoveAurasDueToSpell(SPELL_FREEZE);
pNext->RemoveFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_NOT_SELECTABLE|UNIT_FLAG_NON_ATTACKABLE|UNIT_FLAG_NOT_ATTACKABLE_1|UNIT_FLAG_OOC_NOT_ATTACKABLE);
((Unit*)pNext)->SetStandState(UNIT_STAND_STATE_STAND);
pNext->SetStandState(UNIT_STAND_STATE_STAND);
pNext->SetInCombatWithZone();
pNext->Attack(pNext->SelectNearestTarget(100),true);
@@ -344,7 +344,7 @@ struct boss_ymironAI : public ScriptedAI
void DespawnBoatGhosts(uint64& m_uiCreatureGUID)
{
if (m_uiCreatureGUID)
if (Creature* pTemp = (Creature*)Unit::GetUnit(*m_creature, m_uiCreatureGUID))
if (Creature* pTemp = Unit::GetCreature(*m_creature, m_uiCreatureGUID))
pTemp->DisappearAndDie();
m_uiCreatureGUID = 0;