Skip to content

Commit

Permalink
Chat: Fix crash due to deleting a corpse of a dynguid mob
Browse files Browse the repository at this point in the history
  • Loading branch information
killerwife committed Nov 27, 2024
1 parent bc972d8 commit 9a2af04
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/game/Chat/Level2.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1922,7 +1922,9 @@ bool ChatHandler::HandleNpcDeleteCommand(char* args)
case CREATURE_SUBTYPE_GENERIC:
{
unit->CombatStop();
if (CreatureData const* data = sObjectMgr.GetCreatureData(unit->GetDbGuid()))
if (unit->IsUsingNewSpawningSystem()) // might be used in spawn group or scheduled for respawn already
unit->AddObjectToRemoveList();
else if (CreatureData const* data = sObjectMgr.GetCreatureData(unit->GetDbGuid()))
{
// chat commands execute in world thread so should be thread safe for now
sMapMgr.DoForAllMapsWithMapId(data->mapid, [&](Map* map)
Expand Down

0 comments on commit 9a2af04

Please sign in to comment.