aboutsummaryrefslogtreecommitdiff
path: root/src/server/scripts/Commands
diff options
context:
space:
mode:
authorGiacomo Pozzoni <giacomopoz@gmail.com>2020-08-04 09:36:47 +0000
committerGitHub <noreply@github.com>2020-08-04 11:36:47 +0200
commit07fd84b679fd6958b7e669a96c78783875e1b949 (patch)
tree898e098e9985a08ca84cc9077b132279f43df945 /src/server/scripts/Commands
parentbc6137d08c08ef2fb29e871cf5659c4d1c5c41ab (diff)
Core/Misc: Fix static analysis issues (#25194)
Diffstat (limited to 'src/server/scripts/Commands')
-rw-r--r--src/server/scripts/Commands/cs_gm.cpp2
-rw-r--r--src/server/scripts/Commands/cs_list.cpp6
-rw-r--r--src/server/scripts/Commands/cs_misc.cpp2
3 files changed, 5 insertions, 5 deletions
diff --git a/src/server/scripts/Commands/cs_gm.cpp b/src/server/scripts/Commands/cs_gm.cpp
index f6c0b021367..5aa36785018 100644
--- a/src/server/scripts/Commands/cs_gm.cpp
+++ b/src/server/scripts/Commands/cs_gm.cpp
@@ -142,7 +142,7 @@ public:
handler->SendSysMessage("========================");
}
std::string const& name = itr->second->GetName();
- uint8 size = name.size();
+ uint8 size = uint8(name.size());
uint8 security = itrSec;
uint8 max = ((16 - size) / 2);
uint8 max2 = max;
diff --git a/src/server/scripts/Commands/cs_list.cpp b/src/server/scripts/Commands/cs_list.cpp
index 6c5fb2f70c9..89c21c324c6 100644
--- a/src/server/scripts/Commands/cs_list.cpp
+++ b/src/server/scripts/Commands/cs_list.cpp
@@ -244,7 +244,7 @@ public:
if (count > resultCount)
count -= resultCount;
- else if (count)
+ else
count = 0;
}
@@ -291,7 +291,7 @@ public:
if (count > resultCount)
count -= resultCount;
- else if (count)
+ else
count = 0;
}
@@ -366,7 +366,7 @@ public:
if (count > resultCount)
count -= resultCount;
- else if (count)
+ else
count = 0;
}
diff --git a/src/server/scripts/Commands/cs_misc.cpp b/src/server/scripts/Commands/cs_misc.cpp
index 13df3bdcc2c..c9594eb29d5 100644
--- a/src/server/scripts/Commands/cs_misc.cpp
+++ b/src/server/scripts/Commands/cs_misc.cpp
@@ -1491,7 +1491,7 @@ public:
// the max level of the new profession.
uint16 max = maxPureSkill ? atoul(maxPureSkill) : targetHasSkill ? target->GetPureMaxSkillValue(skill) : uint16(level);
- if (level <= 0 || level > max || max <= 0)
+ if (level <= 0 || level > max)
return false;
// If the player has the skill, we get the current skill step. If they don't have the skill, we