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 <vladimir@getmangos.com>
This commit is contained in:
VladimirMangos 2008-10-31 19:48:08 +01:00 committed by VladimirMangos
parent 4f228f71cd
commit 7b9e86e3f3

View file

@ -5315,9 +5315,11 @@ bool ChatHandler::HandleBanListIPCommand(const char* args)
bool ChatHandler::HandleRespawnCommand(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) if(target->GetTypeId()!=TYPEID_UNIT)
{ {
@ -5331,8 +5333,6 @@ bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
return true; return true;
} }
Player* pl = m_session->GetPlayer();
CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY())); CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
Cell cell(p); Cell cell(p);
cell.data.Part.reserved = ALL_DISTRICT; cell.data.Part.reserved = ALL_DISTRICT;