mirror of
https://github.com/TrinityCore/TrinityCore.git
synced 2026-01-16 07:30:42 +01:00
Scripts/UBRS: Fix crash
Fix crash triggered during Dragonspire Hall event caused by having more than 5 mobs near a rune. Crash added in7c19fb8d0eFix #26589 (cherry picked from commite9a8cea018)
This commit is contained in:
@@ -412,11 +412,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]))
|
||||
{
|
||||
@@ -427,10 +426,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());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -451,9 +447,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;
|
||||
}
|
||||
@@ -528,7 +524,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;
|
||||
GuidList _incarceratorList;
|
||||
|
||||
Reference in New Issue
Block a user