From 7b9e86e3f3af01bbe89ec7ecfe9e3aca487b37e0 Mon Sep 17 00:00:00 2001 From: VladimirMangos Date: Fri, 31 Oct 2008 19:48:08 +0100 Subject: [PATCH] Fixed bug in respawn command from recent commit Command must now ignore implicit self-targeted player as target. And allow respawn all near creatures/go in this case. Signed-off-by: VladimirMangos --- src/game/Level3.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index 87f092a60..c184ec5ea 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -5315,9 +5315,11 @@ bool ChatHandler::HandleBanListIPCommand(const char* args) bool ChatHandler::HandleRespawnCommand(const char* /*args*/) { - Unit* target = getSelectedUnit(); + Player* pl = m_session->GetPlayer(); - if(target) + // accept only explictly selected target (not implicitly self targeting case) + Unit* target = getSelectedUnit(); + if(pl->GetSelection() && target) { if(target->GetTypeId()!=TYPEID_UNIT) { @@ -5331,8 +5333,6 @@ bool ChatHandler::HandleRespawnCommand(const char* /*args*/) return true; } - Player* pl = m_session->GetPlayer(); - CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY())); Cell cell(p); cell.data.Part.reserved = ALL_DISTRICT;