mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 04:37:00 +00:00
[11329] Fix crash in ChatHandler::HandleNpcDeleteCommand() - correctly despawn TemporarySummon objects by using TemporarySummon::UnSummon() function.
Signed-off-by: Ambal <pogrebniak@gala.net>
This commit is contained in:
parent
347070c4bc
commit
735f086992
2 changed files with 13 additions and 4 deletions
|
|
@ -41,6 +41,7 @@
|
|||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <map>
|
||||
#include "TemporarySummon.h"
|
||||
|
||||
#include "TargetedMovementGenerator.h" // for HandleNpcUnFollowCommand
|
||||
|
||||
|
|
@ -1818,9 +1819,17 @@ bool ChatHandler::HandleNpcDeleteCommand(char* args)
|
|||
}
|
||||
|
||||
// Delete the creature
|
||||
unit->CombatStop();
|
||||
unit->DeleteFromDB();
|
||||
unit->AddObjectToRemoveList();
|
||||
if(!unit->IsTemporarySummon())
|
||||
{
|
||||
unit->CombatStop();
|
||||
unit->DeleteFromDB();
|
||||
unit->AddObjectToRemoveList();
|
||||
}
|
||||
else
|
||||
{
|
||||
TemporarySummon * pSummon = static_cast<TemporarySummon* >(unit);
|
||||
pSummon->UnSummon();
|
||||
}
|
||||
|
||||
SendSysMessage(LANG_COMMAND_DELCREATMESSAGE);
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue