mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-13 09:17:18 +00:00
fix(Script/URBS): Potential crash in Dragonspire Room (#6330)
* cherry-picked from commit (e9a8cea018)
Co-Authored-By: Giacomo Pozzoni <giacomopoz@gmail.com>
Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
This commit is contained in:
@@ -393,11 +393,11 @@ 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]))
|
||||
{
|
||||
@@ -409,8 +409,7 @@ public:
|
||||
{
|
||||
if (Creature* creature = *itr)
|
||||
{
|
||||
runecreaturelist[i][creatureCount] = creature->GetGUID();
|
||||
++creatureCount;
|
||||
runecreaturelist[i].push_back(creature->GetGUID());
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -432,9 +431,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;
|
||||
}
|
||||
@@ -554,7 +553,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;
|
||||
ObjectGuid go_urok_pile;
|
||||
|
||||
Reference in New Issue
Block a user