aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/EasternKingdoms
diff options
context:
space:
mode:
authorSpp <spp@jorge.gr>2013-03-21 13:48:36 +0100
committerSpp <spp@jorge.gr>2013-03-21 13:48:36 +0100
commit156fb824a437ea01b207cce37405bfa8a24624e5 (patch)
tree2391db77b8b27c70f771d8a400845660a7f9eaec /src/server/scripts/EasternKingdoms
parent355029fb4f30a3d535a7c360b896b728eee330b6 (diff)
Core/Scripts: Removed CAST_CRE define
Diffstat (limited to 'src/server/scripts/EasternKingdoms')
-rw-r--r--src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp7
-rw-r--r--src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp6
-rw-r--r--src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp6
3 files changed, 10 insertions, 9 deletions
diff --git a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
index 558ffaf7135..cd4eaa78e9d 100644
--- a/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
+++ b/src/server/scripts/EasternKingdoms/Gnomeregan/gnomeregan.cpp
@@ -569,7 +569,8 @@ public:
return;
if (Unit* summon = me->ToTempSummon()->GetSummoner())
- CAST_CRE(summon)->AI()->SetData(2, 1);
+ if (Creature* creature = summon->ToCreature())
+ creature->AI()->SetData(2, 1);
}
void UpdateAI(uint32 /*diff*/)
@@ -586,8 +587,8 @@ public:
return;
if (Unit* summoner = me->ToTempSummon()->GetSummoner())
- if (Creature* summonerCre = summoner->ToCreature())
- summonerCre->AI()->SetData(2, 2);
+ if (Creature* creature = summoner->ToCreature())
+ creature->AI()->SetData(2, 2);
}
};
diff --git a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
index 4ef91b93b43..e2227c3f304 100644
--- a/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
+++ b/src/server/scripts/EasternKingdoms/Karazhan/boss_prince_malchezaar.cpp
@@ -145,9 +145,9 @@ public:
void KilledUnit(Unit* who)
{
- Unit* pMalchezaar = Unit::GetUnit(*me, malchezaar);
- if (pMalchezaar)
- CAST_CRE(pMalchezaar)->AI()->KilledUnit(who);
+ if (Unit* unit = Unit::GetUnit(*me, malchezaar))
+ if (Creature* creature = unit->ToCreature())
+ creature->AI()->KilledUnit(who);
}
void SpellHit(Unit* /*who*/, const SpellInfo* spell)
diff --git a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
index 332baa29b51..6fa7e94e55e 100644
--- a/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
+++ b/src/server/scripts/EasternKingdoms/ZulAman/boss_hexlord.cpp
@@ -274,9 +274,9 @@ class boss_hexlord_malacrass : public CreatureScript
for (uint8 i = 0; i < 4; ++i)
{
- Unit* Temp = Unit::GetUnit(*me, AddGUID[i]);
- if (Temp && Temp->isAlive())
- CAST_CRE(Temp)->AI()->AttackStart(me->getVictim());
+ Creature* creature = Unit::GetCreature(*me, AddGUID[i]);
+ if (creature && creature->isAlive())
+ creature->AI()->AttackStart(me->getVictim());
else
{
EnterEvadeMode();