aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authormegamage <none@none>2009-03-14 19:32:02 -0600
committermegamage <none@none>2009-03-14 19:32:02 -0600
commit721f1d98b56b4f0c7f46bb1d2e17e01e6fbbf956 (patch)
treea2147ae83acfe42543a9c71fb42f312844b31496 /src
parentf3f2f6ac11056e682766c7308ae544c7f6efa785 (diff)
*Fix debug command setbit.
--HG-- branch : trunk
Diffstat (limited to 'src')
-rw-r--r--src/game/Level3.cpp13
1 files 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;
}