diff options
Diffstat (limited to 'src/server')
-rw-r--r-- | src/server/game/Conditions/DisableMgr.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Entities/Creature/Creature.cpp | 2 | ||||
-rw-r--r-- | src/server/game/Garrison/GarrisonMgr.cpp | 4 | ||||
-rw-r--r-- | src/server/game/Globals/ObjectMgr.h | 5 | ||||
-rw-r--r-- | src/server/game/Quests/QuestDef.cpp | 4 |
5 files changed, 9 insertions, 8 deletions
diff --git a/src/server/game/Conditions/DisableMgr.cpp b/src/server/game/Conditions/DisableMgr.cpp index c2527b1d28f..369d538147c 100644 --- a/src/server/game/Conditions/DisableMgr.cpp +++ b/src/server/game/Conditions/DisableMgr.cpp @@ -345,6 +345,8 @@ bool IsDisabledFor(DisableType type, uint32 entry, Unit const* unit, uint8 flags return (disabledModes & RAID_STATUSFLAG_10MAN_HEROIC) != 0; case DIFFICULTY_25_HC: return (disabledModes & RAID_STATUSFLAG_25MAN_HEROIC) != 0; + default: + return false; } } else if (mapEntry->InstanceType == MAP_COMMON) diff --git a/src/server/game/Entities/Creature/Creature.cpp b/src/server/game/Entities/Creature/Creature.cpp index f5db7db13a3..1a6710ff1ac 100644 --- a/src/server/game/Entities/Creature/Creature.cpp +++ b/src/server/game/Entities/Creature/Creature.cpp @@ -1410,7 +1410,7 @@ bool Creature::CanStartAttack(Unit const* who, bool force) const // This set of checks is should be done only for creatures if ((HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_NPC) && who->GetTypeId() != TYPEID_PLAYER) // flag is valid only for non player characters || (HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC) && who->GetTypeId() == TYPEID_PLAYER) // immune to PC and target is a player, return false - || (who->GetOwner() && who->GetOwner()->GetTypeId() == TYPEID_PLAYER) && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC)) // player pets are immune to pc as well + || (who->GetOwner() && who->GetOwner()->GetTypeId() == TYPEID_PLAYER && HasFlag(UNIT_FIELD_FLAGS, UNIT_FLAG_IMMUNE_TO_PC))) // player pets are immune to pc as well return false; // Do not attack non-combat pets diff --git a/src/server/game/Garrison/GarrisonMgr.cpp b/src/server/game/Garrison/GarrisonMgr.cpp index a27574f4df4..349ebdc42a1 100644 --- a/src/server/game/Garrison/GarrisonMgr.cpp +++ b/src/server/game/Garrison/GarrisonMgr.cpp @@ -161,7 +161,7 @@ std::list<GarrAbilityEntry const*> GarrisonMgr::RollFollowerAbilities(GarrFollow bool hasForcedExclusiveTrait = false; std::list<GarrAbilityEntry const*> result; - int32 slots[2] = { AbilitiesForQuality[quality][0], AbilitiesForQuality[quality][1] }; + uint32 slots[2] = { AbilitiesForQuality[quality][0], AbilitiesForQuality[quality][1] }; GarrAbilities const* abilities = nullptr; auto itr = _garrisonFollowerAbilities[faction].find(follower->ID); @@ -270,7 +270,7 @@ std::list<GarrAbilityEntry const*> GarrisonMgr::RollFollowerAbilities(GarrFollow if ((*itr)->Flags & GARRISON_ABILITY_FLAG_EXCLUSIVE) break; - while (traitList.size() < std::max<int32>(0, slots[1] - forcedTraits.size()) && total) + while (traitList.size() < size_t(std::max<int32>(0, slots[1] - forcedTraits.size())) && total) { auto itr = genericTraits.begin(); std::advance(itr, urand(0, total-- - 1)); diff --git a/src/server/game/Globals/ObjectMgr.h b/src/server/game/Globals/ObjectMgr.h index f7b2b6a5408..ec3fa29b952 100644 --- a/src/server/game/Globals/ObjectMgr.h +++ b/src/server/game/Globals/ObjectMgr.h @@ -39,6 +39,7 @@ #include "ConditionMgr.h" #include "DB2Stores.h" #include <string> +#include <tuple> #include <map> #include <limits> #include <functional> @@ -67,8 +68,8 @@ struct TempSummonGroupKey bool operator<(TempSummonGroupKey const& rhs) const { - // memcmp is only reliable if struct doesn't have any padding (packed) - return memcmp(this, &rhs, sizeof(TempSummonGroupKey)) < 0; + return std::tie(_summonerEntry, _summonerType, _summonGroup) < + std::tie(rhs._summonerEntry, rhs._summonerType, rhs._summonGroup); } private: diff --git a/src/server/game/Quests/QuestDef.cpp b/src/server/game/Quests/QuestDef.cpp index 93930cdba54..c1098b4cf52 100644 --- a/src/server/game/Quests/QuestDef.cpp +++ b/src/server/game/Quests/QuestDef.cpp @@ -243,9 +243,7 @@ uint32 Quest::XPValue(uint32 playerLevel) const uint32 Quest::MoneyValue(uint8 playerLevel) const { - uint8 level; - if (playerLevel) - level = Level == -1 ? playerLevel : Level; + uint8 level = Level == -1 ? playerLevel : Level; if (QuestMoneyRewardEntry const* money = sQuestMoneyRewardStore.LookupEntry(level)) return money->Money[GetRewMoneyDifficulty()] * GetMoneyMultiplier(); |