fix(Script/URBS): Potential crash in Dragonspire Room (#6330)
* cherry-picked from commit (https://github.com/TrinityCore/TrinityCore/commit/e9a8cea018591334ce3807e2eb2fc2d6ce079252) Co-Authored-By: Giacomo Pozzoni <giacomopoz@gmail.com> Co-authored-by: Giacomo Pozzoni <giacomopoz@gmail.com>
This commit is contained in:
+6
-7
@@ -393,11 +393,11 @@ public:
|
|||||||
|
|
||||||
void Dragonspireroomstore()
|
void Dragonspireroomstore()
|
||||||
{
|
{
|
||||||
uint8 creatureCount;
|
|
||||||
|
|
||||||
for (uint8 i = 0; i < 7; ++i)
|
for (uint8 i = 0; i < 7; ++i)
|
||||||
{
|
{
|
||||||
creatureCount = 0;
|
// Refresh the creature list
|
||||||
|
runecreaturelist[i].clear();
|
||||||
|
|
||||||
if (GameObject* rune = instance->GetGameObject(go_roomrunes[i]))
|
if (GameObject* rune = instance->GetGameObject(go_roomrunes[i]))
|
||||||
{
|
{
|
||||||
@@ -409,8 +409,7 @@ public:
|
|||||||
{
|
{
|
||||||
if (Creature* creature = *itr)
|
if (Creature* creature = *itr)
|
||||||
{
|
{
|
||||||
runecreaturelist[i][creatureCount] = creature->GetGUID();
|
runecreaturelist[i].push_back(creature->GetGUID());
|
||||||
++creatureCount;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -432,9 +431,9 @@ public:
|
|||||||
|
|
||||||
if (rune->GetGoState() == GO_STATE_ACTIVE)
|
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())
|
if (mob && mob->IsAlive())
|
||||||
_mobAlive = true;
|
_mobAlive = true;
|
||||||
}
|
}
|
||||||
@@ -554,7 +553,7 @@ public:
|
|||||||
ObjectGuid go_blackrockaltar;
|
ObjectGuid go_blackrockaltar;
|
||||||
ObjectGuid go_roomrunes[7];
|
ObjectGuid go_roomrunes[7];
|
||||||
ObjectGuid go_emberseerrunes[7];
|
ObjectGuid go_emberseerrunes[7];
|
||||||
ObjectGuid runecreaturelist[7][5];
|
GuidVector runecreaturelist[7];
|
||||||
ObjectGuid go_portcullis_active;
|
ObjectGuid go_portcullis_active;
|
||||||
ObjectGuid go_portcullis_tobossrooms;
|
ObjectGuid go_portcullis_tobossrooms;
|
||||||
ObjectGuid go_urok_pile;
|
ObjectGuid go_urok_pile;
|
||||||
|
|||||||
Reference in New Issue
Block a user