aboutsummaryrefslogtreecommitdiff
path: root/src/server/game/Globals/ObjectMgr.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/server/game/Globals/ObjectMgr.cpp')
-rw-r--r--src/server/game/Globals/ObjectMgr.cpp18
1 files changed, 9 insertions, 9 deletions
diff --git a/src/server/game/Globals/ObjectMgr.cpp b/src/server/game/Globals/ObjectMgr.cpp
index a054014d5bd..cd480574a11 100644
--- a/src/server/game/Globals/ObjectMgr.cpp
+++ b/src/server/game/Globals/ObjectMgr.cpp
@@ -4076,7 +4076,7 @@ void ObjectMgr::LoadPlayerInfo()
uint32 classMask = fields[1].GetUInt32();
uint32 spellId = fields[2].GetUInt32();
- if (raceMask && !(raceMask.RawValue & RACEMASK_ALL_PLAYABLE))
+ if (!raceMask.IsEmpty() && (raceMask & RACEMASK_ALL_PLAYABLE).IsEmpty())
{
TC_LOG_ERROR("sql.sql", "Wrong race mask " UI64FMTD " in `playercreateinfo_spell_custom` table, ignoring.", raceMask.RawValue);
continue;
@@ -4090,7 +4090,7 @@ void ObjectMgr::LoadPlayerInfo()
for (uint32 raceIndex = RACE_HUMAN; raceIndex < MAX_RACES; ++raceIndex)
{
- if (!raceMask || raceMask.HasRace(raceIndex))
+ if (raceMask.IsEmpty() || raceMask.HasRace(raceIndex))
{
for (uint32 classIndex = CLASS_WARRIOR; classIndex < MAX_CLASSES; ++classIndex)
{
@@ -4137,7 +4137,7 @@ void ObjectMgr::LoadPlayerInfo()
uint32 spellId = fields[2].GetUInt32();
int8 playerCreateMode = fields[3].GetInt8();
- if (raceMask && !(raceMask.RawValue & RACEMASK_ALL_PLAYABLE))
+ if (!raceMask.IsEmpty() && (raceMask & RACEMASK_ALL_PLAYABLE).IsEmpty())
{
TC_LOG_ERROR("sql.sql", "Wrong race mask " UI64FMTD " in `playercreateinfo_cast_spell` table, ignoring.", raceMask.RawValue);
continue;
@@ -4157,7 +4157,7 @@ void ObjectMgr::LoadPlayerInfo()
for (uint32 raceIndex = RACE_HUMAN; raceIndex < MAX_RACES; ++raceIndex)
{
- if (!raceMask || raceMask.HasRace(raceIndex))
+ if (raceMask.IsEmpty() || raceMask.HasRace(raceIndex))
{
for (uint32 classIndex = CLASS_WARRIOR; classIndex < MAX_CLASSES; ++classIndex)
{
@@ -4812,7 +4812,7 @@ void ObjectMgr::LoadQuests()
// AllowableRaces, can be -1/RACEMASK_ALL_PLAYABLE to allow any race
if (qinfo->_allowableRaces.RawValue != uint64(-1))
{
- if (qinfo->_allowableRaces && !(qinfo->_allowableRaces.RawValue & RACEMASK_ALL_PLAYABLE))
+ if (!qinfo->_allowableRaces.IsEmpty() && (qinfo->_allowableRaces & RACEMASK_ALL_PLAYABLE).IsEmpty())
{
TC_LOG_ERROR("sql.sql", "Quest %u does not contain any playable races in `AllowableRaces` (" UI64FMTD "), value set to -1 (all races).", qinfo->GetQuestId(), qinfo->_allowableRaces.RawValue);
qinfo->_allowableRaces.RawValue = uint64(-1);
@@ -9071,7 +9071,7 @@ int32 ObjectMgr::GetBaseReputationOf(FactionEntry const* factionEntry, uint8 rac
{
if ((!factionEntry->ReputationClassMask[i] ||
factionEntry->ReputationClassMask[i] & classMask) &&
- (!factionEntry->ReputationRaceMask[i] ||
+ (factionEntry->ReputationRaceMask[i].IsEmpty() ||
factionEntry->ReputationRaceMask[i].HasRace(race)))
return factionEntry->ReputationBase[i];
}
@@ -9282,7 +9282,7 @@ void ObjectMgr::LoadMailLevelRewards()
Field* fields = result->Fetch();
uint8 level = fields[0].GetUInt8();
- uint64 raceMask = fields[1].GetUInt64();
+ Trinity::RaceMask<uint64> raceMask = { fields[1].GetUInt64() };
uint32 mailTemplateId = fields[2].GetUInt32();
uint32 senderEntry = fields[3].GetUInt32();
@@ -9292,9 +9292,9 @@ void ObjectMgr::LoadMailLevelRewards()
continue;
}
- if (!(raceMask & RACEMASK_ALL_PLAYABLE))
+ if ((raceMask & RACEMASK_ALL_PLAYABLE).IsEmpty())
{
- TC_LOG_ERROR("sql.sql", "Table `mail_level_reward` has raceMask (" UI64FMTD ") for level %u that not include any player races, ignoring.", raceMask, level);
+ TC_LOG_ERROR("sql.sql", "Table `mail_level_reward` has raceMask (" UI64FMTD ") for level %u that not include any player races, ignoring.", raceMask.RawValue, level);
continue;
}