*Allow to use gm command to modify mob health.
--HG-- branch : trunk
This commit is contained in:
+5
-5
@@ -1107,7 +1107,7 @@ bool ChatHandler::HandleModifyHPCommand(const char* args)
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
Player *chr = getSelectedPlayer();
|
Unit *chr = getSelectedUnit();
|
||||||
if (chr == NULL)
|
if (chr == NULL)
|
||||||
{
|
{
|
||||||
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
SendSysMessage(LANG_NO_CHAR_SELECTED);
|
||||||
@@ -1116,12 +1116,12 @@ bool ChatHandler::HandleModifyHPCommand(const char* args)
|
|||||||
}
|
}
|
||||||
|
|
||||||
// check online security
|
// check online security
|
||||||
if (HasLowerSecurity(chr, 0))
|
if (chr->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)chr, 0))
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
PSendSysMessage(LANG_YOU_CHANGE_HP, GetNameLink(chr).c_str(), hp, hpm);
|
PSendSysMessage(LANG_YOU_CHANGE_HP, GetNameLink((Player*)chr).c_str(), hp, hpm);
|
||||||
if (needReportToTarget(chr))
|
if (chr->GetTypeId() == TYPEID_PLAYER && needReportToTarget((Player*)chr))
|
||||||
ChatHandler(chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetNameLink().c_str(), hp, hpm);
|
ChatHandler((Player*)chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetNameLink().c_str(), hp, hpm);
|
||||||
|
|
||||||
chr->SetMaxHealth( hpm );
|
chr->SetMaxHealth( hpm );
|
||||||
chr->SetHealth( hp );
|
chr->SetHealth( hp );
|
||||||
|
|||||||
Reference in New Issue
Block a user