mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 13:37:05 +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
|
||||
if(!unit->IsTemporarySummon())
|
||||
{
|
||||
unit->CombatStop();
|
||||
unit->DeleteFromDB();
|
||||
unit->AddObjectToRemoveList();
|
||||
}
|
||||
else
|
||||
{
|
||||
TemporarySummon * pSummon = static_cast<TemporarySummon* >(unit);
|
||||
pSummon->UnSummon();
|
||||
}
|
||||
|
||||
SendSysMessage(LANG_COMMAND_DELCREATMESSAGE);
|
||||
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
#ifndef __REVISION_NR_H__
|
||||
#define __REVISION_NR_H__
|
||||
#define REVISION_NR "11328"
|
||||
#define REVISION_NR "11329"
|
||||
#endif // __REVISION_NR_H__
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue