diff options
| author | megamage <none@none> | 2009-05-26 15:29:31 -0500 |
|---|---|---|
| committer | megamage <none@none> | 2009-05-26 15:29:31 -0500 |
| commit | 484060351000c0e2dd8a7773b90387a7209ffd21 (patch) | |
| tree | 2b84f4750147c307561afbe92e672d3177a9d9ba /src | |
| parent | 60a0c4a695996084eddf973627c92ced5adb49ef (diff) | |
*Allow to use gm command to modify mob health.
--HG--
branch : trunk
Diffstat (limited to 'src')
| -rw-r--r-- | src/game/Level1.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index 5dba3ce5063..83d08529424 100644 --- a/src/game/Level1.cpp +++ b/src/game/Level1.cpp @@ -1107,7 +1107,7 @@ bool ChatHandler::HandleModifyHPCommand(const char* args) return false; } - Player *chr = getSelectedPlayer(); + Unit *chr = getSelectedUnit(); if (chr == NULL) { SendSysMessage(LANG_NO_CHAR_SELECTED); @@ -1116,12 +1116,12 @@ bool ChatHandler::HandleModifyHPCommand(const char* args) } // check online security - if (HasLowerSecurity(chr, 0)) + if (chr->GetTypeId() == TYPEID_PLAYER && HasLowerSecurity((Player*)chr, 0)) return false; - PSendSysMessage(LANG_YOU_CHANGE_HP, GetNameLink(chr).c_str(), hp, hpm); - if (needReportToTarget(chr)) - ChatHandler(chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetNameLink().c_str(), hp, hpm); + PSendSysMessage(LANG_YOU_CHANGE_HP, GetNameLink((Player*)chr).c_str(), hp, hpm); + if (chr->GetTypeId() == TYPEID_PLAYER && needReportToTarget((Player*)chr)) + ChatHandler((Player*)chr).PSendSysMessage(LANG_YOURS_HP_CHANGED, GetNameLink().c_str(), hp, hpm); chr->SetMaxHealth( hpm ); chr->SetHealth( hp ); |
