From 1b1767e9f4c20d1e20541968de98d00814f63247 Mon Sep 17 00:00:00 2001 From: Yehonal Date: Sat, 20 Aug 2016 09:49:37 +0200 Subject: Fix commands and starting to use nullptr instead of NULL --- src/scripts/Commands/cs_modify.cpp | 33 +++++++++++++++------------------ 1 file changed, 15 insertions(+), 18 deletions(-) (limited to 'src/scripts/Commands/cs_modify.cpp') diff --git a/src/scripts/Commands/cs_modify.cpp b/src/scripts/Commands/cs_modify.cpp index a087c4dc4d..94fb1d0cfa 100644 --- a/src/scripts/Commands/cs_modify.cpp +++ b/src/scripts/Commands/cs_modify.cpp @@ -33,8 +33,7 @@ public: { "walk", SEC_GAMEMASTER, false, &HandleModifySpeedCommand, "" }, { "backwalk", SEC_GAMEMASTER, false, &HandleModifyBWalkCommand, "" }, { "swim", SEC_GAMEMASTER, false, &HandleModifySwimCommand, "" }, - { "", SEC_GAMEMASTER, false, &HandleModifyASpeedCommand, "" }, - { NULL, 0, false, NULL, "" } + { "", SEC_GAMEMASTER, false, &HandleModifyASpeedCommand, "" } }; static std::vector modifyCommandTable = @@ -58,15 +57,13 @@ public: { "standstate", SEC_GAMEMASTER, false, &HandleModifyStandStateCommand, "" }, { "phase", SEC_ADMINISTRATOR, false, &HandleModifyPhaseCommand, "" }, { "gender", SEC_GAMEMASTER, false, &HandleModifyGenderCommand, "" }, - { "speed", SEC_GAMEMASTER, false, NULL, "", modifyspeedCommandTable }, - { NULL, 0, false, NULL, "" } + { "speed", SEC_GAMEMASTER, false, nullptr, "", modifyspeedCommandTable } }; static std::vector commandTable = { { "morph", SEC_GAMEMASTER, false, &HandleModifyMorphCommand, "" }, { "demorph", SEC_GAMEMASTER, false, &HandleDeMorphCommand, "" }, - { "modify", SEC_GAMEMASTER, false, NULL, "", modifyCommandTable }, - { NULL, 0, false, NULL, "" } + { "modify", SEC_GAMEMASTER, false, nullptr, "", modifyCommandTable } }; return commandTable; } @@ -156,7 +153,7 @@ public: // if (!pmana) // return false; - // char* pmanaMax = strtok(NULL, " "); + // char* pmanaMax = strtok(nullptr, " "); // if (!pmanaMax) // return false; @@ -207,7 +204,7 @@ public: // if (!pmana) // return false; - // char* pmanaMax = strtok(NULL, " "); + // char* pmanaMax = strtok(nullptr, " "); // if (!pmanaMax) // return false; @@ -319,13 +316,13 @@ public: uint32 factionid = atoi(pfactionid); uint32 flag; - char *pflag = strtok(NULL, " "); + char *pflag = strtok(nullptr, " "); if (!pflag) flag = target->GetUInt32Value(UNIT_FIELD_FLAGS); else flag = atoi(pflag); - char* pnpcflag = strtok(NULL, " "); + char* pnpcflag = strtok(nullptr, " "); uint32 npcflag; if (!pnpcflag) @@ -333,7 +330,7 @@ public: else npcflag = atoi(pnpcflag); - char* pdyflag = strtok(NULL, " "); + char* pdyflag = strtok(nullptr, " "); uint32 dyflag; if (!pdyflag) @@ -368,17 +365,17 @@ public: if (!pspellflatid) return false; - char* pop = strtok(NULL, " "); + char* pop = strtok(nullptr, " "); if (!pop) return false; - char* pval = strtok(NULL, " "); + char* pval = strtok(nullptr, " "); if (!pval) return false; uint16 mark; - char* pmark = strtok(NULL, " "); + char* pmark = strtok(nullptr, " "); uint8 spellflatid = atoi(pspellflatid); uint8 op = atoi(pop); @@ -389,7 +386,7 @@ public: mark = atoi(pmark); Player* target = handler->getSelectedPlayer(); - if (target == NULL) + if (target == nullptr) { handler->SendSysMessage(LANG_NO_CHAR_SELECTED); handler->SetSentErrorMessage(true); @@ -1080,7 +1077,7 @@ public: if (!pField) return false; - char* pBit = strtok(NULL, " "); + char* pBit = strtok(nullptr, " "); if (!pBit) return false; @@ -1178,7 +1175,7 @@ public: uint32 factionId = atoi(factionTxt); int32 amount = 0; - char *rankTxt = strtok(NULL, " "); + char *rankTxt = strtok(nullptr, " "); if (!factionTxt || !rankTxt) return false; @@ -1207,7 +1204,7 @@ public: if (wrank.substr(0, wrankStr.size()) == wrankStr) { - char *deltaTxt = strtok(NULL, " "); + char *deltaTxt = strtok(nullptr, " "); if (deltaTxt) { int32 delta = atoi(deltaTxt); -- cgit v1.2.3