From 484060351000c0e2dd8a7773b90387a7209ffd21 Mon Sep 17 00:00:00 2001 From: megamage Date: Tue, 26 May 2009 15:29:31 -0500 Subject: [PATCH] *Allow to use gm command to modify mob health. --HG-- branch : trunk --- src/game/Level1.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/game/Level1.cpp b/src/game/Level1.cpp index 5dba3ce506..83d0852942 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 );