fix(Scripts/Ulduar): Fixed console errors of uninstalling vehicles. (#11334)
Fixes #11314
This commit is contained in:
@@ -664,8 +664,12 @@ public:
|
|||||||
{
|
{
|
||||||
Map::PlayerList const& pList = instance->GetPlayers();
|
Map::PlayerList const& pList = instance->GetPlayers();
|
||||||
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||||
if (Vehicle* veh = itr->GetSource()->GetVehicle())
|
{
|
||||||
veh->Dismiss();
|
if (Creature* vehicleCreature = itr->GetSource()->GetVehicleCreatureBase())
|
||||||
|
{
|
||||||
|
vehicleCreature->DespawnOrUnsummon();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TYPE_IGNIS:
|
case TYPE_IGNIS:
|
||||||
@@ -837,8 +841,12 @@ public:
|
|||||||
{
|
{
|
||||||
Map::PlayerList const& pList = instance->GetPlayers();
|
Map::PlayerList const& pList = instance->GetPlayers();
|
||||||
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
for (Map::PlayerList::const_iterator itr = pList.begin(); itr != pList.end(); ++itr)
|
||||||
if (Vehicle* veh = itr->GetSource()->GetVehicle())
|
{
|
||||||
veh->Dismiss();
|
if (Creature* vehicleCreature = itr->GetSource()->GetVehicleCreatureBase())
|
||||||
|
{
|
||||||
|
vehicleCreature->DespawnOrUnsummon();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1239,9 +1247,12 @@ void instance_ulduar::instance_ulduar_InstanceMapScript::SpawnLeviathanEncounter
|
|||||||
if (!_leviathanVehicles.empty())
|
if (!_leviathanVehicles.empty())
|
||||||
{
|
{
|
||||||
for (ObjectGuid const& guid : _leviathanVehicles)
|
for (ObjectGuid const& guid : _leviathanVehicles)
|
||||||
|
{
|
||||||
if (Creature* cr = instance->GetCreature(guid))
|
if (Creature* cr = instance->GetCreature(guid))
|
||||||
if (Vehicle* veh = cr->GetVehicleKit())
|
{
|
||||||
veh->Dismiss();
|
cr->DespawnOrUnsummon();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
_leviathanVehicles.clear();
|
_leviathanVehicles.clear();
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user