Fix crash in script for quest 10512 + code style cleanup.
--HG-- branch : trunk
This commit is contained in:
@@ -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();
|
||||
}
|
||||
@@ -454,7 +454,7 @@ struct npc_ogre_bruteAI : public ScriptedAI
|
||||
me->SetReactState(REACT_AGGRESSIVE);
|
||||
me->GetMotionMaster()->MoveTargetedHome();
|
||||
Creature* Credit = me->FindNearestCreature(NPC_QUEST_CREDIT, 50, true);
|
||||
if(pPlayer)
|
||||
if (pPlayer && Credit)
|
||||
pPlayer->KilledMonster(Credit->GetCreatureInfo(), Credit->GetGUID());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user