aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/scripts')
-rw-r--r--src/server/scripts/Commands/cs_account.cpp2
-rw-r--r--src/server/scripts/Commands/cs_debug.cpp2
-rw-r--r--src/server/scripts/Commands/cs_guild.cpp2
-rw-r--r--src/server/scripts/Commands/cs_instance.cpp2
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp14
-rw-r--r--src/server/scripts/Commands/cs_npc.cpp2
-rw-r--r--src/server/scripts/Kalimdor/zone_tanaris.cpp2
-rw-r--r--src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp4
-rw-r--r--src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp4
-rw-r--r--src/server/scripts/Outland/zone_shadowmoon_valley.cpp4
10 files changed, 21 insertions, 17 deletions
diff --git a/src/server/scripts/Commands/cs_account.cpp b/src/server/scripts/Commands/cs_account.cpp
index 4b7aa8ecad3..91e42fc68f7 100644
--- a/src/server/scripts/Commands/cs_account.cpp
+++ b/src/server/scripts/Commands/cs_account.cpp
@@ -775,7 +775,7 @@ public:
if (handler->HasLowerSecurityAccount(NULL, targetAccountId, true))
return false;
- if (strcmp(password, passwordConfirmation))
+ if (strcmp(password, passwordConfirmation) != 0)
{
handler->SendSysMessage(LANG_NEW_PASSWORDS_NOT_MATCH);
handler->SetSentErrorMessage(true);
diff --git a/src/server/scripts/Commands/cs_debug.cpp b/src/server/scripts/Commands/cs_debug.cpp
index a2c71607eaa..6a810070347 100644
--- a/src/server/scripts/Commands/cs_debug.cpp
+++ b/src/server/scripts/Commands/cs_debug.cpp
@@ -320,7 +320,7 @@ public:
std::string type;
parsedStream >> type;
- if (type == "")
+ if (type.empty())
break;
if (type == "uint8")
diff --git a/src/server/scripts/Commands/cs_guild.cpp b/src/server/scripts/Commands/cs_guild.cpp
index f03be6e4530..7c025cd4e95 100644
--- a/src/server/scripts/Commands/cs_guild.cpp
+++ b/src/server/scripts/Commands/cs_guild.cpp
@@ -249,7 +249,7 @@ public:
{
Guild* guild = nullptr;
- if (args && strlen(args) > 0)
+ if (args && args[0] != '\0')
{
if (isNumeric(args))
{
diff --git a/src/server/scripts/Commands/cs_instance.cpp b/src/server/scripts/Commands/cs_instance.cpp
index 464d58ad908..a426c49a5f7 100644
--- a/src/server/scripts/Commands/cs_instance.cpp
+++ b/src/server/scripts/Commands/cs_instance.cpp
@@ -125,7 +125,7 @@ public:
uint16 counter = 0;
uint16 MapId = 0;
- if (strcmp(map, "all"))
+ if (strcmp(map, "all") != 0)
{
MapId = uint16(atoi(map));
if (!MapId)
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 8e720e9faba..27b6cd562d7 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -199,10 +199,12 @@ public:
else
handler->PSendSysMessage(LANG_GPS_NO_VMAP);
+ char const* unknown = handler->GetTrinityString(LANG_UNKNOWN);
+
handler->PSendSysMessage(LANG_MAP_POSITION,
- mapId, (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : handler->GetTrinityString(LANG_UNKNOWN)),
- zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : handler->GetTrinityString(LANG_UNKNOWN)),
- areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : handler->GetTrinityString(LANG_UNKNOWN)),
+ mapId, (mapEntry ? mapEntry->name[handler->GetSessionDbcLocale()] : unknown),
+ zoneId, (zoneEntry ? zoneEntry->area_name[handler->GetSessionDbcLocale()] : unknown),
+ areaId, (areaEntry ? areaEntry->area_name[handler->GetSessionDbcLocale()] : unknown),
object->GetPhaseMask(),
object->GetPositionX(), object->GetPositionY(), object->GetPositionZ(), object->GetOrientation(),
cell.GridX(), cell.GridY(), cell.CellX(), cell.CellY(), object->GetInstanceId(),
@@ -1711,7 +1713,9 @@ public:
}
if (target)
- handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name[locale], (!zoneName.empty() ? zoneName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)), (!areaName.empty() ? areaName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)));
+ handler->PSendSysMessage(LANG_PINFO_CHR_MAP, map->name[locale],
+ (!zoneName.empty() ? zoneName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)),
+ (!areaName.empty() ? areaName.c_str() : handler->GetTrinityString(LANG_UNKNOWN)));
// Output XVII. - XVIX. if they are not empty
if (!guildName.empty())
@@ -2187,7 +2191,7 @@ public:
{
Player* target = NULL;
- if (args && strlen(args) > 0)
+ if (args && args[0] != '\0')
{
target = sObjectAccessor->FindPlayerByName(args);
if (!target)
diff --git a/src/server/scripts/Commands/cs_npc.cpp b/src/server/scripts/Commands/cs_npc.cpp
index 5f4c8d0dfd4..987c12debb7 100644
--- a/src/server/scripts/Commands/cs_npc.cpp
+++ b/src/server/scripts/Commands/cs_npc.cpp
@@ -681,7 +681,7 @@ public:
}
creature->AI()->SetData(data_1, data_2);
- std::string AIorScript = creature->GetAIName() != "" ? "AI type: " + creature->GetAIName() : (creature->GetScriptName() != "" ? "Script Name: " + creature->GetScriptName() : "No AI or Script Name Set");
+ std::string AIorScript = !creature->GetAIName().empty() ? "AI type: " + creature->GetAIName() : (!creature->GetScriptName().empty() ? "Script Name: " + creature->GetScriptName() : "No AI or Script Name Set");
handler->PSendSysMessage(LANG_NPC_SETDATA, creature->GetGUID().GetCounter(), creature->GetEntry(), creature->GetName().c_str(), data_1, data_2, AIorScript.c_str());
return true;
}
diff --git a/src/server/scripts/Kalimdor/zone_tanaris.cpp b/src/server/scripts/Kalimdor/zone_tanaris.cpp
index ec2fa7b398e..62337487b1c 100644
--- a/src/server/scripts/Kalimdor/zone_tanaris.cpp
+++ b/src/server/scripts/Kalimdor/zone_tanaris.cpp
@@ -105,7 +105,7 @@ public:
ItemPosCountVec dest;
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 11522, 1, NULL);
if (msg == EQUIP_ERR_OK)
- player->StoreNewItem(dest, 11522, 1, true);
+ player->StoreNewItem(dest, 11522, true);
}
}
diff --git a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
index cf33e08eeeb..d5bd2bcae7e 100644
--- a/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
+++ b/src/server/scripts/Northrend/CrusadersColiseum/TrialOfTheCrusader/boss_anubarak_trial.cpp
@@ -196,7 +196,7 @@ class boss_anubarak_trial : public CreatureScript
std::list<Creature*> FrostSphereList;
me->GetCreatureListWithEntryInGrid(FrostSphereList, NPC_FROST_SPHERE, 150.0f);
if (!FrostSphereList.empty())
- for (std::list<Creature*>::iterator itr = FrostSphereList.begin(); itr != FrostSphereList.end(); itr++)
+ for (std::list<Creature*>::iterator itr = FrostSphereList.begin(); itr != FrostSphereList.end(); ++itr)
(*itr)->DespawnOrUnsummon();
_burrowGUID.clear();
@@ -243,7 +243,7 @@ class boss_anubarak_trial : public CreatureScript
me->GetCreatureListWithEntryInGrid(AddList, NPC_FROST_SPHERE, 150.0f);
me->GetCreatureListWithEntryInGrid(AddList, NPC_BURROWER, 150.0f);
if (!AddList.empty())
- for (std::list<Creature*>::iterator itr = AddList.begin(); itr != AddList.end(); itr++)
+ for (std::list<Creature*>::iterator itr = AddList.begin(); itr != AddList.end(); ++itr)
(*itr)->DespawnOrUnsummon();
}
diff --git a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
index d00208b0d6f..016c0bff1e5 100644
--- a/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
+++ b/src/server/scripts/Northrend/Ulduar/Ulduar/instance_ulduar.cpp
@@ -140,8 +140,8 @@ class instance_ulduar : public InstanceMapScript
_algalonSummoned = false;
_summonAlgalon = false;
- memset(_summonObservationRingKeeper, false, sizeof(_summonObservationRingKeeper));
- memset(_summonYSKeeper, false, sizeof(_summonYSKeeper));
+ memset(_summonObservationRingKeeper, 0, sizeof(_summonObservationRingKeeper));
+ memset(_summonYSKeeper, 0, sizeof(_summonYSKeeper));
}
void FillInitialWorldStates(WorldPacket& packet) override
diff --git a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
index 358b5d44387..54a7455d3f8 100644
--- a/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
+++ b/src/server/scripts/Outland/zone_shadowmoon_valley.cpp
@@ -459,7 +459,7 @@ public:
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30658, 1, NULL);
if (msg == EQUIP_ERR_OK)
{
- player->StoreNewItem(dest, 30658, 1, true);
+ player->StoreNewItem(dest, 30658, true);
player->PlayerTalkClass->ClearMenus();
}
}
@@ -469,7 +469,7 @@ public:
uint8 msg = player->CanStoreNewItem(NULL_BAG, NULL_SLOT, dest, 30659, 1, NULL);
if (msg == EQUIP_ERR_OK)
{
- player->StoreNewItem(dest, 30659, 1, true);
+ player->StoreNewItem(dest, 30659, true);
player->PlayerTalkClass->ClearMenus();
}
}