Skip to content
This repository has been archived by the owner on Jul 27, 2020. It is now read-only.

Gilneas crashfix #715

Merged
merged 1 commit into from Aug 11, 2012
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
12 changes: 8 additions & 4 deletions src/server/scripts/EasternKingdoms/Gilneas/gilneas.cpp
Expand Up @@ -547,7 +547,7 @@ class npc_rampaging_worgen2 : public CreatureScript
class go_merchant_square_door : public GameObjectScript
{
public:
go_merchant_square_door() : GameObjectScript("go_merchant_square_door") {}
go_merchant_square_door() : GameObjectScript("go_merchant_square_door"), aPlayer(NULL) {}

float x, y, z, wx, wy, angle, tQuestCredit;
bool opened;
Expand Down Expand Up @@ -601,15 +601,19 @@ class go_merchant_square_door : public GameObjectScript
if (tQuestCredit <= ((float)diff/8))
{
opened = 0;
aPlayer->KilledMonsterCredit(35830, 0);

if(aPlayer)
aPlayer->KilledMonsterCredit(35830, 0);

if (spawnKind == 3)
{
if (Creature* spawnedCreature = go->SummonCreature(NPC_RAMPAGING_WORGEN_2, wx, wy, z, angle, TEMPSUMMON_TIMED_DESPAWN, SUMMON1_TTL))
{
spawnedCreature->SetPhaseMask(6, 1);
spawnedCreature->Respawn(1);
spawnedCreature->getThreatManager().resetAllAggro();
aPlayer->AddThreat(spawnedCreature, 1.0f);
if(aPlayer)
aPlayer->AddThreat(spawnedCreature, 1.0f);
spawnedCreature->AddThreat(aPlayer, 1.0f);
}
}
Expand Down Expand Up @@ -1708,4 +1712,4 @@ void AddSC_gilneas()
new npc_greymane_horse();
new npc_krennan_aranas_c2();
new npc_bloodfang_stalker_c1();
}
}