Skip to content

Commit

Permalink
fix(Script/URBS): Potential crash in Dragonspire Room (azerothcore#6330)
Browse files Browse the repository at this point in the history
* cherry-picked from commit (TrinityCore/TrinityCore@e9a8cea)

Co-Authored-By: Giacomo Pozzoni <[email protected]>

Co-authored-by: Giacomo Pozzoni <[email protected]>
  • Loading branch information
Kitzunu and jackpoz authored Jun 15, 2021
1 parent 65d70ca commit 34da0cd
Showing 1 changed file with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -393,11 +393,11 @@ class instance_blackrock_spire : public InstanceMapScript

void Dragonspireroomstore()
{
uint8 creatureCount;

for (uint8 i = 0; i < 7; ++i)
{
creatureCount = 0;
// Refresh the creature list
runecreaturelist[i].clear();

if (GameObject* rune = instance->GetGameObject(go_roomrunes[i]))
{
Expand All @@ -409,8 +409,7 @@ class instance_blackrock_spire : public InstanceMapScript
{
if (Creature* creature = *itr)
{
runecreaturelist[i][creatureCount] = creature->GetGUID();
++creatureCount;
runecreaturelist[i].push_back(creature->GetGUID());
}
}
}
Expand All @@ -432,9 +431,9 @@ class instance_blackrock_spire : public InstanceMapScript

if (rune->GetGoState() == GO_STATE_ACTIVE)
{
for (uint8 ii = 0; ii < 5; ++ii)
for (ObjectGuid const& guid : runecreaturelist[i])
{
mob = instance->GetCreature(runecreaturelist[i][ii]);
mob = instance->GetCreature(guid);
if (mob && mob->IsAlive())
_mobAlive = true;
}
Expand Down Expand Up @@ -554,7 +553,7 @@ class instance_blackrock_spire : public InstanceMapScript
ObjectGuid go_blackrockaltar;
ObjectGuid go_roomrunes[7];
ObjectGuid go_emberseerrunes[7];
ObjectGuid runecreaturelist[7][5];
GuidVector runecreaturelist[7];
ObjectGuid go_portcullis_active;
ObjectGuid go_portcullis_tobossrooms;
ObjectGuid go_urok_pile;
Expand Down

0 comments on commit 34da0cd

Please sign in to comment.