Scripts/UBRS: Fix crash
Fix crash triggered during Dragonspire Hall event caused by having more than 5 mobs near a rune.
Crash added in 7c19fb8d0e
Fix #26589
This commit is contained in:
1 parent
3301b87dba
commit
ea85a0031c
1 file changed
+6
-10
+6
-10
@@ -392,11 +392,10 @@ public:
|
||||
|
||||
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]))
|
||||
{
|
||||
@@ -407,10 +406,7 @@ public:
|
||||
for (std::list<Creature*>::iterator itr = creatureList.begin(); itr != creatureList.end(); ++itr)
|
||||
{
|
||||
if (Creature* creature = *itr)
|
||||
{
|
||||
runecreaturelist[i][creatureCount] = creature->GetGUID();
|
||||
++creatureCount;
|
||||
}
|
||||
runecreaturelist[i].push_back(creature->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -431,9 +427,9 @@ public:
|
||||
|
||||
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;
|
||||
}
|
||||
@@ -508,7 +504,7 @@ public:
|
||||
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;
|
||||
};
|
||||
|
||||
Reference in new issue
Block a user