aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMachiavelli <none@none>2010-05-05 01:38:47 +0200
committerMachiavelli <none@none>2010-05-05 01:38:47 +0200
commitb54a361d60b6b2c0296fb4a3e07ab029ee63163e (patch)
tree2d9a42c199660962b74952dfe69d98932423ace5
parent6649215e6135f13903f75c1e146f10b973aabd3a (diff)
Fix crash in script for quest 10512 + code style cleanup.
--HG-- branch : trunk
-rw-r--r--src/scripts/outland/blades_edge_mountains.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/scripts/outland/blades_edge_mountains.cpp b/src/scripts/outland/blades_edge_mountains.cpp
index 231a27ccc9a..7d2b56d872d 100644
--- a/src/scripts/outland/blades_edge_mountains.cpp
+++ b/src/scripts/outland/blades_edge_mountains.cpp
@@ -436,7 +436,7 @@ struct npc_ogre_bruteAI : public ScriptedAI
{
if (!who || (!who->isAlive())) return;
- if (me->IsWithinDistInMap(who, 50.0f) && (who->GetTypeId() == TYPEID_PLAYER) && CAST_PLR(who)->GetQuestStatus(10512) == QUEST_STATUS_INCOMPLETE)
+ if (me->IsWithinDistInMap(who, 50.0f) && (who->GetTypeId() == TYPEID_PLAYER) && who->ToPlayer()->GetQuestStatus(10512) == QUEST_STATUS_INCOMPLETE)
{
PlayerGUID = who->GetGUID();
}
@@ -445,17 +445,17 @@ struct npc_ogre_bruteAI : public ScriptedAI
void MovementInform(uint32 type, uint32 id)
{
Player* pPlayer = Unit::GetPlayer(PlayerGUID);
- if(id == 1)
+ if (id == 1)
{
GameObject* Keg = me->FindNearestGameObject(GO_KEG, 20);
- if(Keg)
+ if (Keg)
Keg->Delete();
me->HandleEmoteCommand(7);
me->SetReactState(REACT_AGGRESSIVE);
me->GetMotionMaster()->MoveTargetedHome();
Creature* Credit = me->FindNearestCreature(NPC_QUEST_CREDIT, 50, true);
- if(pPlayer)
- pPlayer->KilledMonster(Credit->GetCreatureInfo(),Credit->GetGUID());
+ if (pPlayer && Credit)
+ pPlayer->KilledMonster(Credit->GetCreatureInfo(), Credit->GetGUID());
}
}