From 721f1d98b56b4f0c7f46bb1d2e17e01e6fbbf956 Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 14 Mar 2009 19:32:02 -0600 Subject: *Fix debug command setbit. --HG-- branch : trunk --- src/game/Level3.cpp | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/game/Level3.cpp b/src/game/Level3.cpp index bbf6f47d949..7ca960775a6 100644 --- a/src/game/Level3.cpp +++ b/src/game/Level3.cpp @@ -4761,6 +4761,14 @@ bool ChatHandler::HandleSet32Bit(const char* args) if(!*args) return false; + Unit* target = getSelectedUnit(); + if(!target) + { + SendSysMessage(LANG_SELECT_CHAR_OR_CREATURE); + SetSentErrorMessage(true); + return false; + } + char* px = strtok((char*)args, " "); char* py = strtok(NULL, " "); @@ -4774,9 +4782,10 @@ bool ChatHandler::HandleSet32Bit(const char* args) sLog.outDebug(GetTrinityString(LANG_SET_32BIT), Opcode, Value); - m_session->GetPlayer( )->SetUInt32Value( Opcode , 2^Value ); + uint32 iValue = Value ? 1 << (Value - 1) : 0; + target->SetUInt32Value( Opcode , iValue); - PSendSysMessage(LANG_SET_32BIT_FIELD, Opcode,1); + PSendSysMessage(LANG_SET_32BIT_FIELD, Opcode, iValue); return true; } -- cgit v1.2.3