Core/Creature: Fix a crash in .npc delete, Also fix an issue breaking vehicles in certain edge case situations.
Port From (https://github.com/TrinityCore/TrinityCore/commit/b538cdc129e6132ddd6afc2c5ac5ccaae2959730)
This commit is contained in:
@@ -383,7 +383,7 @@ namespace Game.Entities
|
|||||||
{
|
{
|
||||||
triggerJustAppeared = false;
|
triggerJustAppeared = false;
|
||||||
GetAI().JustAppeared();
|
GetAI().JustAppeared();
|
||||||
if (VehicleKit != null)
|
if (m_respawnCompatibilityMode && VehicleKit != null)
|
||||||
VehicleKit.Reset();
|
VehicleKit.Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -1480,8 +1480,8 @@ namespace Game.Entities
|
|||||||
DB.World.CommitTransaction(trans);
|
DB.World.CommitTransaction(trans);
|
||||||
|
|
||||||
// then delete any active instances of the creature
|
// then delete any active instances of the creature
|
||||||
var range = GetMap().GetCreatureBySpawnIdStore().LookupByKey(m_spawnId);
|
var spawnMap = GetMap().GetCreatureBySpawnIdStore().LookupByKey(m_spawnId);
|
||||||
foreach (var creature in range)
|
foreach (var creature in spawnMap)
|
||||||
creature.AddObjectToRemoveList();
|
creature.AddObjectToRemoveList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user