mirror of
https://github.com/mangosfour/server.git
synced 2025-12-13 22:37:03 +00:00
Use .respawn only for selected creature (if any)
If no creature is selected, old behavior is used (respawn everything). Thanks Seline for the diff. Signed-off-by: freghar <compmancz@gmail.com> (cherry picked from commit 6bbdffac9acb9c02a74be632b35a90f0bda3ccb0) Signed-off-by: VladimirMangos <vladimir@getmangos.com> Some changes in creature targeting and work in case alive target. Help data updated. Signed-off-by: VladimirMangos <vladimir@getmangos.com>
This commit is contained in:
parent
e98a123027
commit
4db0c00181
4 changed files with 23 additions and 1 deletions
|
|
@ -5315,6 +5315,22 @@ bool ChatHandler::HandleBanListIPCommand(const char* args)
|
|||
|
||||
bool ChatHandler::HandleRespawnCommand(const char* /*args*/)
|
||||
{
|
||||
Unit* target = getSelectedUnit();
|
||||
|
||||
if(target)
|
||||
{
|
||||
if(target->GetTypeId()!=TYPEID_UNIT)
|
||||
{
|
||||
SendSysMessage(LANG_SELECT_CREATURE);
|
||||
SetSentErrorMessage(true);
|
||||
return false;
|
||||
}
|
||||
|
||||
if(target->isDead())
|
||||
((Creature*)target)->Respawn();
|
||||
return true;
|
||||
}
|
||||
|
||||
Player* pl = m_session->GetPlayer();
|
||||
|
||||
CellPair p(MaNGOS::ComputeCellPair(pl->GetPositionX(), pl->GetPositionY()));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue