Skip to content

Commit

Permalink
Scripts/Silithus: Few summons were being spawned at wrong locations (…
Browse files Browse the repository at this point in the history
…out of bounds array)

Fixes a crash and/or console errors
  • Loading branch information
w1sht0l1v3 authored and DDuarte committed Apr 6, 2012
1 parent 2560642 commit 478427e
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions src/server/scripts/Kalimdor/silithus.cpp
Expand Up @@ -373,8 +373,13 @@ static QuestCinematic EventAnim[]=
{0, 0, 0} {0, 0, 0}
}; };


struct Location
{
float x, y, z, o;
};

//Cordinates for Spawns //Cordinates for Spawns
static const Position SpawnLocation[]= static Location SpawnLocation[]=
{ {
{-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry {-8085.0f, 1528.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
{-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry {-8080.0f, 1526.0f, 2.61f, 3.141592f}, //Kaldorei Infantry
Expand Down Expand Up @@ -485,9 +490,9 @@ class npc_anachronos_the_ancient : public CreatureScript
public: public:
npc_anachronos_the_ancient() : CreatureScript("npc_anachronos_the_ancient") { } npc_anachronos_the_ancient() : CreatureScript("npc_anachronos_the_ancient") { }


CreatureAI* GetAI(Creature* c) const CreatureAI* GetAI(Creature* creature) const
{ {
return new npc_anachronos_the_ancientAI(c); return new npc_anachronos_the_ancientAI(creature);
} }


struct npc_anachronos_the_ancientAI : public ScriptedAI struct npc_anachronos_the_ancientAI : public ScriptedAI
Expand Down Expand Up @@ -813,9 +818,9 @@ class mob_qiraj_war_spawn : public CreatureScript
public: public:
mob_qiraj_war_spawn() : CreatureScript("mob_qiraj_war_spawn") { } mob_qiraj_war_spawn() : CreatureScript("mob_qiraj_war_spawn") { }


CreatureAI* GetAI(Creature* c) const CreatureAI* GetAI(Creature* creature) const
{ {
return new mob_qiraj_war_spawnAI(c); return new mob_qiraj_war_spawnAI(creature);
} }


struct mob_qiraj_war_spawnAI : public ScriptedAI struct mob_qiraj_war_spawnAI : public ScriptedAI
Expand Down Expand Up @@ -928,9 +933,9 @@ class npc_anachronos_quest_trigger : public CreatureScript
public: public:
npc_anachronos_quest_trigger() : CreatureScript("npc_anachronos_quest_trigger") { } npc_anachronos_quest_trigger() : CreatureScript("npc_anachronos_quest_trigger") { }


CreatureAI* GetAI(Creature* c) const CreatureAI* GetAI(Creature* creature) const
{ {
return new npc_anachronos_quest_triggerAI(c); return new npc_anachronos_quest_triggerAI(creature);
} }


struct npc_anachronos_quest_triggerAI : public ScriptedAI struct npc_anachronos_quest_triggerAI : public ScriptedAI
Expand Down Expand Up @@ -974,7 +979,14 @@ class npc_anachronos_quest_trigger : public CreatureScript
//uint8 QirajiWaspCount = 0; //uint8 QirajiWaspCount = 0;
for (uint8 i = 0; i < 67; ++i) for (uint8 i = 0; i < 67; ++i)
{ {
if (Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, SpawnLocation[locIndex + i], TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, WavesInfo[WaveCount].DespTimer)) float X = SpawnLocation[locIndex + i].x;
float Y = SpawnLocation[locIndex + i].y;
float Z = SpawnLocation[locIndex + i].z;
float O = SpawnLocation[locIndex + i].o;
uint32 desptimer = WavesInfo[WaveCount].DespTimer;
Creature* spawn = me->SummonCreature(WavesInfo[WaveCount].CreatureId, X, Y, Z, O, TEMPSUMMON_TIMED_OR_DEAD_DESPAWN, desptimer);

if (spawn)
{ {
spawn->LoadCreaturesAddon(); spawn->LoadCreaturesAddon();
if (spawn->GetEntry() == 15423) if (spawn->GetEntry() == 15423)
Expand Down

0 comments on commit 478427e

Please sign in to comment.