mirror of
https://github.com/mod-playerbots/azerothcore-wotlk.git
synced 2026-01-15 18:10:26 +00:00
Fix commands and starting to use nullptr instead of NULL
This commit is contained in:
@@ -34,14 +34,12 @@ public:
|
||||
{ "stats", SEC_ADMINISTRATOR, true, &HandleInstanceStatsCommand, "" },
|
||||
{ "savedata", SEC_ADMINISTRATOR, false, &HandleInstanceSaveDataCommand, "" },
|
||||
{ "setbossstate", SEC_GAMEMASTER, true, &HandleInstanceSetBossStateCommand, "" },
|
||||
{ "getbossstate", SEC_GAMEMASTER, true, &HandleInstanceGetBossStateCommand, "" },
|
||||
{ NULL, 0, false, NULL, "" }
|
||||
{ "getbossstate", SEC_GAMEMASTER, true, &HandleInstanceGetBossStateCommand, "" }
|
||||
};
|
||||
|
||||
static std::vector<ChatCommand> commandTable =
|
||||
{
|
||||
{ "instance", SEC_ADMINISTRATOR, true, NULL, "", instanceCommandTable },
|
||||
{ NULL, 0, false, NULL, "" }
|
||||
{ "instance", SEC_ADMINISTRATOR, true, nullptr, "", instanceCommandTable }
|
||||
};
|
||||
|
||||
return commandTable;
|
||||
@@ -73,7 +71,7 @@ public:
|
||||
{
|
||||
InstanceSave* save = itr->second.save;
|
||||
uint32 resetTime = itr->second.extended ? save->GetExtendedResetTime() : save->GetResetTime();
|
||||
uint32 ttr = (resetTime >= time(NULL) ? resetTime - time(NULL) : 0);
|
||||
uint32 ttr = (resetTime >= time(nullptr) ? resetTime - time(nullptr) : 0);
|
||||
std::string timeleft = GetTimeString(ttr);
|
||||
handler->PSendSysMessage("map: %d, inst: %d, perm: %s, diff: %d, canReset: %s, TTR: %s%s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str(), (itr->second.extended ? " (extended)" : ""));
|
||||
counter++;
|
||||
@@ -94,7 +92,7 @@ public:
|
||||
player = handler->GetSession()->GetPlayer();
|
||||
|
||||
char* map = strtok((char*)args, " ");
|
||||
char* pDiff = strtok(NULL, " ");
|
||||
char* pDiff = strtok(nullptr, " ");
|
||||
int8 diff = -1;
|
||||
if (pDiff)
|
||||
diff = atoi(pDiff);
|
||||
@@ -117,7 +115,7 @@ public:
|
||||
if (itr->first != player->GetMapId() && (!MapId || MapId == itr->first) && (diff == -1 || diff == save->GetDifficulty()))
|
||||
{
|
||||
uint32 resetTime = itr->second.extended ? save->GetExtendedResetTime() : save->GetResetTime();
|
||||
uint32 ttr = (resetTime >= time(NULL) ? resetTime - time(NULL) : 0);
|
||||
uint32 ttr = (resetTime >= time(nullptr) ? resetTime - time(nullptr) : 0);
|
||||
std::string timeleft = GetTimeString(ttr);
|
||||
handler->PSendSysMessage("unbinding map: %d, inst: %d, perm: %s, diff: %d, canReset: %s, TTR: %s%s", itr->first, save->GetInstanceId(), itr->second.perm ? "yes" : "no", save->GetDifficulty(), save->CanReset() ? "yes" : "no", timeleft.c_str(), (itr->second.extended ? " (extended)" : ""));
|
||||
sInstanceSaveMgr->PlayerUnbindInstance(player->GetGUIDLow(), itr->first, Difficulty(i), true, player);
|
||||
@@ -175,11 +173,11 @@ public:
|
||||
return false;
|
||||
|
||||
char* param1 = strtok((char*)args, " ");
|
||||
char* param2 = strtok(NULL, " ");
|
||||
char* param3 = strtok(NULL, " ");
|
||||
char* param2 = strtok(nullptr, " ");
|
||||
char* param3 = strtok(nullptr, " ");
|
||||
uint32 encounterId = 0;
|
||||
int32 state = 0;
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
std::string playerName;
|
||||
|
||||
// Character name must be provided when using this from console.
|
||||
@@ -244,9 +242,9 @@ public:
|
||||
return false;
|
||||
|
||||
char* param1 = strtok((char*)args, " ");
|
||||
char* param2 = strtok(NULL, " ");
|
||||
char* param2 = strtok(nullptr, " ");
|
||||
uint32 encounterId = 0;
|
||||
Player* player = NULL;
|
||||
Player* player = nullptr;
|
||||
std::string playerName;
|
||||
|
||||
// Character name must be provided when using this from console.
|
||||
|
||||
Reference in New Issue
Block a user