From de849cc5087e9a11ddff2f4e9ec42b1ec293cf2a Mon Sep 17 00:00:00 2001 From: megamage Date: Sat, 21 Mar 2009 14:53:38 -0600 Subject: Small code cleanup and partial merge with dev branch Author: tomrus88 --HG-- branch : trunk --- src/game/Debugcmds.cpp | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) (limited to 'src/game/Debugcmds.cpp') diff --git a/src/game/Debugcmds.cpp b/src/game/Debugcmds.cpp index 30eb3b6704c..73aff0dbb09 100644 --- a/src/game/Debugcmds.cpp +++ b/src/game/Debugcmds.cpp @@ -667,3 +667,27 @@ bool ChatHandler::HandleDebugSendSetPhaseShiftCommand(const char* args) m_session->SendSetPhaseShift(PhaseShift); return true; } + +bool ChatHandler::HandleDebugSetItemFlagCommand(const char* args) +{ + if(!args) + return false; + + char* e = strtok((char*)args, " "); + char* f = strtok(NULL, " "); + + if (!e || !f) + return false; + + uint32 guid = (uint32)atoi(e); + uint32 flag = (uint32)atoi(f); + + Item *i = m_session->GetPlayer()->GetItemByGuid(MAKE_NEW_GUID(guid, 0, HIGHGUID_ITEM)); + + if(!i) + return false; + + i->SetUInt32Value(ITEM_FIELD_FLAGS, flag); + + return true; +} -- cgit v1.2.3