summaryrefslogtreecommitdiff
path: root/src/scripts/Commands/cs_gobject.cpp
diff options
context:
space:
mode:
authorYehonal <yehonal.azeroth@gmail.com>2016-08-20 09:49:37 +0200
committerYehonal <yehonal.azeroth@gmail.com>2016-08-20 09:49:37 +0200
commit1b1767e9f4c20d1e20541968de98d00814f63247 (patch)
treeee95040cf29644aff151f9aebdf3bfd9e18ae08d /src/scripts/Commands/cs_gobject.cpp
parentd7fdf7c940317aebcbbeeaf156469e1571e01498 (diff)
Fix commands and starting to use nullptr instead of NULL
Diffstat (limited to 'src/scripts/Commands/cs_gobject.cpp')
-rw-r--r--src/scripts/Commands/cs_gobject.cpp54
1 files changed, 25 insertions, 29 deletions
diff --git a/src/scripts/Commands/cs_gobject.cpp b/src/scripts/Commands/cs_gobject.cpp
index 465a491f41..bbb80fb0f1 100644
--- a/src/scripts/Commands/cs_gobject.cpp
+++ b/src/scripts/Commands/cs_gobject.cpp
@@ -33,14 +33,12 @@ public:
static std::vector<ChatCommand> gobjectAddCommandTable =
{
{ "temp", SEC_GAMEMASTER, false, &HandleGameObjectAddTempCommand, "" },
- { "", SEC_GAMEMASTER, false, &HandleGameObjectAddCommand, "" },
- { NULL, 0, false, NULL, "" }
+ { "", SEC_GAMEMASTER, false, &HandleGameObjectAddCommand, "" }
};
static std::vector<ChatCommand> gobjectSetCommandTable =
{
{ "phase", SEC_GAMEMASTER, false, &HandleGameObjectSetPhaseCommand, "" },
- { "state", SEC_GAMEMASTER, false, &HandleGameObjectSetStateCommand, "" },
- { NULL, 0, false, NULL, "" }
+ { "state", SEC_GAMEMASTER, false, &HandleGameObjectSetStateCommand, "" }
};
static std::vector<ChatCommand> gobjectCommandTable =
{
@@ -51,14 +49,12 @@ public:
{ "near", SEC_GAMEMASTER, false, &HandleGameObjectNearCommand, "" },
{ "target", SEC_GAMEMASTER, false, &HandleGameObjectTargetCommand, "" },
{ "turn", SEC_GAMEMASTER, false, &HandleGameObjectTurnCommand, "" },
- { "add", SEC_GAMEMASTER, false, NULL, "", gobjectAddCommandTable },
- { "set", SEC_GAMEMASTER, false, NULL, "", gobjectSetCommandTable },
- { NULL, 0, false, NULL, "" }
+ { "add", SEC_GAMEMASTER, false, nullptr, "", gobjectAddCommandTable },
+ { "set", SEC_GAMEMASTER, false, nullptr, "", gobjectSetCommandTable }
};
static std::vector<ChatCommand> commandTable =
{
- { "gobject", SEC_GAMEMASTER, false, NULL, "", gobjectCommandTable },
- { NULL, 0, false, NULL, "" }
+ { "gobject", SEC_GAMEMASTER, false, nullptr, "", gobjectCommandTable }
};
return commandTable;
}
@@ -76,7 +72,7 @@ public:
if (!guidLow)
return false;
- GameObject* object = NULL;
+ GameObject* object = nullptr;
// by DB guid
if (GameObjectData const* goData = sObjectMgr->GetGOData(guidLow))
@@ -113,7 +109,7 @@ public:
if (!objectId)
return false;
- char* spawntimeSecs = strtok(NULL, " ");
+ char* spawntimeSecs = strtok(nullptr, " ");
const GameObjectTemplate* objectInfo = sObjectMgr->GetGameObjectTemplate(objectId);
@@ -188,7 +184,7 @@ public:
Player* player = handler->GetSession()->GetPlayer();
- char* spawntime = strtok(NULL, " ");
+ char* spawntime = strtok(nullptr, " ");
uint32 spawntm = 300;
if (spawntime)
@@ -240,7 +236,7 @@ public:
else
{
std::ostringstream eventFilter;
- eventFilter << " AND (eventEntry IS NULL ";
+ eventFilter << " AND (eventEntry IS nullptr ";
bool initString = true;
for (GameEventMgr::ActiveEvents::const_iterator itr = activeEventsList.begin(); itr != activeEventsList.end(); ++itr)
@@ -314,7 +310,7 @@ public:
if (target)
{
- int32 curRespawnDelay = int32(target->GetRespawnTimeEx() - time(NULL));
+ int32 curRespawnDelay = int32(target->GetRespawnTimeEx() - time(nullptr));
if (curRespawnDelay < 0)
curRespawnDelay = 0;
@@ -338,7 +334,7 @@ public:
if (!guidLow)
return false;
- GameObject* object = NULL;
+ GameObject* object = nullptr;
// by DB guid
if (GameObjectData const* gameObjectData = sObjectMgr->GetGOData(guidLow))
@@ -386,7 +382,7 @@ public:
if (!guidLow)
return false;
- GameObject* object = NULL;
+ GameObject* object = nullptr;
// by DB guid
if (GameObjectData const* gameObjectData = sObjectMgr->GetGOData(guidLow))
@@ -399,17 +395,17 @@ public:
return false;
}
- char* orientation = strtok(NULL, " ");
+ char* orientation = strtok(nullptr, " ");
float oz = 0.f, oy = 0.f, ox = 0.f;
if (orientation)
{
oz = float(atof(orientation));
- orientation = strtok(NULL, " ");
+ orientation = strtok(nullptr, " ");
if (orientation)
{
oy = float(atof(orientation));
- orientation = strtok(NULL, " ");
+ orientation = strtok(nullptr, " ");
if (orientation)
ox = float(atof(orientation));
}
@@ -444,7 +440,7 @@ public:
if (!guidLow)
return false;
- GameObject* object = NULL;
+ GameObject* object = nullptr;
// by DB guid
if (GameObjectData const* gameObjectData = sObjectMgr->GetGOData(guidLow))
@@ -457,9 +453,9 @@ public:
return false;
}
- char* toX = strtok(NULL, " ");
- char* toY = strtok(NULL, " ");
- char* toZ = strtok(NULL, " ");
+ char* toX = strtok(nullptr, " ");
+ char* toY = strtok(nullptr, " ");
+ char* toZ = strtok(nullptr, " ");
if (!toX)
{
@@ -509,7 +505,7 @@ public:
if (!guidLow)
return false;
- GameObject* object = NULL;
+ GameObject* object = nullptr;
// by DB guid
if (GameObjectData const* gameObjectData = sObjectMgr->GetGOData(guidLow))
@@ -522,7 +518,7 @@ public:
return false;
}
- char* phase = strtok (NULL, " ");
+ char* phase = strtok (nullptr, " ");
uint32 phaseMask = phase ? atoi(phase) : 0;
if (phaseMask == 0)
{
@@ -589,7 +585,7 @@ public:
uint32 displayId = 0;
std::string name;
uint32 lootId = 0;
- GameObject* gameObject = NULL;
+ GameObject* gameObject = nullptr;
if (!*args)
{
@@ -646,7 +642,7 @@ public:
if (!guidLow)
return false;
- GameObject* object = NULL;
+ GameObject* object = nullptr;
if (guidLow > 0)
{
@@ -664,7 +660,7 @@ public:
return false;
}
- char* type = strtok(NULL, " ");
+ char* type = strtok(nullptr, " ");
if (!type)
return false;
@@ -678,7 +674,7 @@ public:
return true;
}
- char* state = strtok(NULL, " ");
+ char* state = strtok(nullptr, " ");
if (!state)
return false;