[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:
Ambal 2011-04-11 22:07:43 +03:00
parent 347070c4bc
commit 735f086992
2 changed files with 13 additions and 4 deletions

View file

@ -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);

View file

@ -1,4 +1,4 @@
#ifndef __REVISION_NR_H__
#define __REVISION_NR_H__
#define REVISION_NR "11328"
#define REVISION_NR "11329"
#endif // __REVISION_NR_H__