Core/Commands: Allow combatstop command to be used from console with the player name as parameter

Signed-off-by: Subv <s.v.h21@hotmail.com>
This commit is contained in:
Subv committed 2012-04-01 11:03:47 -05:00
1 parent 8bd228179d
commit 2987d4f40d
2 files changed
+17 -4

No files matched your search

+16 -3
View File
@@ -713,9 +713,22 @@ bool ChatHandler::HandleLookupEventCommand(const char* args)
bool ChatHandler::HandleCombatStopCommand(const char* args)
{
Player* target;
if (!extractPlayerTarget((char*)args, &target))
return false;
Player* target = NULL;
if (args && strlen(args) > 0)
{
target = sObjectAccessor->FindPlayerByName(args);
if (!target)
{
SendSysMessage(LANG_PLAYER_NOT_FOUND);
SetSentErrorMessage(true);
return false;
}
}
if (!target)
if (!extractPlayerTarget((char*)args, &target))
return false;
// check online security
if (HasLowerSecurity(target, 0))