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_learn.cpp | 24 ++++++++++-------------- 1 file changed, 10 insertions(+), 14 deletions(-) (limited to 'src/scripts/Commands/cs_learn.cpp') diff --git a/src/scripts/Commands/cs_learn.cpp b/src/scripts/Commands/cs_learn.cpp index 662be7c98c..a24f7dfa39 100644 --- a/src/scripts/Commands/cs_learn.cpp +++ b/src/scripts/Commands/cs_learn.cpp @@ -32,33 +32,29 @@ public: { "class", SEC_ADMINISTRATOR, false, &HandleLearnAllMyClassCommand, "" }, { "pettalents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyPetTalentsCommand, "" }, { "spells", SEC_ADMINISTRATOR, false, &HandleLearnAllMySpellsCommand, "" }, - { "talents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyTalentsCommand, "" }, - { NULL, 0, false, NULL, "" } + { "talents", SEC_ADMINISTRATOR, false, &HandleLearnAllMyTalentsCommand, "" } }; static std::vector learnAllCommandTable = { - { "my", SEC_ADMINISTRATOR, false, NULL, "", learnAllMyCommandTable }, + { "my", SEC_ADMINISTRATOR, false, nullptr, "", learnAllMyCommandTable }, { "gm", SEC_GAMEMASTER, false, &HandleLearnAllGMCommand, "" }, { "crafts", SEC_GAMEMASTER, false, &HandleLearnAllCraftsCommand, "" }, { "default", SEC_GAMEMASTER, false, &HandleLearnAllDefaultCommand, "" }, { "lang", SEC_GAMEMASTER, false, &HandleLearnAllLangCommand, "" }, - { "recipes", SEC_GAMEMASTER, false, &HandleLearnAllRecipesCommand, "" }, - { NULL, 0, false, NULL, "" } + { "recipes", SEC_GAMEMASTER, false, &HandleLearnAllRecipesCommand, "" } }; static std::vector learnCommandTable = { - { "all", SEC_ADMINISTRATOR, false, NULL, "", learnAllCommandTable }, - { "", SEC_ADMINISTRATOR, false, &HandleLearnCommand, "" }, - { NULL, 0, false, NULL, "" } + { "all", SEC_ADMINISTRATOR, false, nullptr, "", learnAllCommandTable }, + { "", SEC_ADMINISTRATOR, false, &HandleLearnCommand, "" } }; static std::vector commandTable = { - { "learn", SEC_GAMEMASTER, false, NULL, "", learnCommandTable }, - { "unlearn", SEC_ADMINISTRATOR, false, &HandleUnLearnCommand, "" }, - { NULL, 0, false, NULL, "" } + { "learn", SEC_GAMEMASTER, false, nullptr, "", learnCommandTable }, + { "unlearn", SEC_ADMINISTRATOR, false, &HandleUnLearnCommand, "" } }; return commandTable; } @@ -103,7 +99,7 @@ public: return false; } - char const* all = strtok(NULL, " "); + char const* all = strtok(nullptr, " "); bool allRanks = all ? (strncmp(all, "all", strlen(all)) == 0) : false; if (!allRanks && targetPlayer->HasSpell(spell)) @@ -389,7 +385,7 @@ public: std::string name; - SkillLineEntry const* targetSkillInfo = NULL; + SkillLineEntry const* targetSkillInfo = nullptr; for (uint32 i = 1; i < sSkillLineStore.GetNumRows(); ++i) { SkillLineEntry const* skillInfo = sSkillLineStore.LookupEntry(i); @@ -485,7 +481,7 @@ public: if (!spellId) return false; - char const* allStr = strtok(NULL, " "); + char const* allStr = strtok(nullptr, " "); bool allRanks = allStr ? (strncmp(allStr, "all", strlen(allStr)) == 0) : false; Player* target = handler->getSelectedPlayer(); -- cgit v1.2.3