diff options
Diffstat (limited to 'src/server/scripts/Commands')
| -rw-r--r-- | src/server/scripts/Commands/cs_account.cpp | 8 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_debug.cpp | 14 | ||||
| -rw-r--r-- | src/server/scripts/Commands/cs_wp.cpp | 20 |
3 files changed, 16 insertions, 26 deletions
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp index c63e47fbc50..17bc0daec5b 100644 --- a/src/server/scripts/Commands/cs_account.cpp +++ b/src/server/scripts/Commands/cs_account.cpp @@ -282,11 +282,7 @@ public: return false; } - std::string password_old = old_pass; - std::string password_new = new_pass; - std::string password_new_c = new_pass_c; - - if (!sAccountMgr->CheckPassword(handler->GetSession()->GetAccountId(), password_old)) + if (!sAccountMgr->CheckPassword(handler->GetSession()->GetAccountId(), std::string(old_pass))) { handler->SendSysMessage(LANG_COMMAND_WRONGOLDPASSWORD); handler->SetSentErrorMessage(true); @@ -300,7 +296,7 @@ public: return false; } - AccountOpResult result = sAccountMgr->ChangePassword(handler->GetSession()->GetAccountId(), password_new); + AccountOpResult result = sAccountMgr->ChangePassword(handler->GetSession()->GetAccountId(), std::string(new_pass)); switch(result) { case AOR_OK: diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp index a3e862c0812..ec96aa0ee65 100644 --- a/src/server/scripts/Commands/cs_debug.cpp +++ b/src/server/scripts/Commands/cs_debug.cpp @@ -1012,20 +1012,19 @@ public: handler->PSendSysMessage(LANG_TOO_BIG_INDEX, Opcode, GUID_LOPART(guid), target->GetValuesCount()); return false; } - uint32 iValue; - float fValue; + bool isint32 = true; if (pz) isint32 = (bool)atoi(pz); if (isint32) { - iValue = (uint32)atoi(py); + uint32 iValue = (uint32)atoi(py); target->SetUInt32Value(Opcode , iValue); handler->PSendSysMessage(LANG_SET_UINT_FIELD, GUID_LOPART(guid), Opcode, iValue); } else { - fValue = (float)atof(py); + float fValue = (float)atof(py); target->SetFloatValue(Opcode , fValue); handler->PSendSysMessage(LANG_SET_FLOAT_FIELD, GUID_LOPART(guid), Opcode, fValue); } @@ -1060,20 +1059,19 @@ public: handler->PSendSysMessage(LANG_TOO_BIG_INDEX, Opcode, GUID_LOPART(guid), target->GetValuesCount()); return false; } - uint32 iValue; - float fValue; + bool isint32 = true; if (pz) isint32 = (bool)atoi(pz); if (isint32) { - iValue = target->GetUInt32Value(Opcode); + uint32 iValue = target->GetUInt32Value(Opcode); handler->PSendSysMessage(LANG_GET_UINT_FIELD, GUID_LOPART(guid), Opcode, iValue); } else { - fValue = target->GetFloatValue(Opcode); + float fValue = target->GetFloatValue(Opcode); handler->PSendSysMessage(LANG_GET_FLOAT_FIELD, GUID_LOPART(guid), Opcode, fValue); } diff --git a/src/server/scripts/Commands/cs_wp.cpp b/src/server/scripts/Commands/cs_wp.cpp index 4dbc47de4ce..184e24c1488 100644 --- a/src/server/scripts/Commands/cs_wp.cpp +++ b/src/server/scripts/Commands/cs_wp.cpp @@ -199,7 +199,7 @@ public: } static bool HandleWpUnLoadCommand(ChatHandler* handler, const char* /*args*/) { - uint32 guidlow = 0; + Creature* target = handler->getSelectedCreature(); if (!target) @@ -208,11 +208,13 @@ public: return true; } + uint32 guidlow = target->GetDBTableGUIDLow(); + if (target->GetCreatureAddon()) { if (target->GetCreatureAddon()->path_id != 0) { - WorldDatabase.PExecute("DELETE FROM creature_addon WHERE guid = %u", target->GetGUIDLow()); + WorldDatabase.PExecute("DELETE FROM creature_addon WHERE guid = %u", guidlow); target->UpdateWaypointID(0); WorldDatabase.PExecute("UPDATE creature SET MovementType = '%u' WHERE guid = '%u'", IDLE_MOTION_TYPE, guidlow); target->LoadPath(0); @@ -373,8 +375,6 @@ public: return true; } - float coord; - if (arg_str_2 == "setid") { uint32 newid = atoi(arg_3); @@ -394,33 +394,29 @@ public: if (arg_str_2 == "posx") { - coord = (float)(atof(arg_3)); WorldDatabase.PExecute("UPDATE waypoint_scripts SET x='%f' WHERE guid='%u'", - coord, id); + (float)(atof(arg_3)), id); handler->PSendSysMessage("|cff00ff00Waypoint script:|r|cff00ffff %u|r|cff00ff00 position_x updated.|r", id); return true; } else if (arg_str_2 == "posy") { - coord = (float)(atof(arg_3)); WorldDatabase.PExecute("UPDATE waypoint_scripts SET y='%f' WHERE guid='%u'", - coord, id); + (float)(atof(arg_3)), id); handler->PSendSysMessage("|cff00ff00Waypoint script: %u position_y updated.|r", id); return true; } else if (arg_str_2 == "posz") { - coord = (float)(atof(arg_3)); WorldDatabase.PExecute("UPDATE waypoint_scripts SET z='%f' WHERE guid='%u'", - coord, id); + (float)(atof(arg_3)), id); handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 position_z updated.|r", id); return true; } else if (arg_str_2 == "orientation") { - coord = (float)(atof(arg_3)); WorldDatabase.PExecute("UPDATE waypoint_scripts SET o='%f' WHERE guid='%u'", - coord, id); + (float)(atof(arg_3)), id); handler->PSendSysMessage("|cff00ff00Waypoint script: |r|cff00ffff%u|r|cff00ff00 orientation updated.|r", id); return true; } |
