diff options
author | ccrs <ccrs@users.noreply.github.com> | 2019-07-01 21:36:32 +0200 |
---|---|---|
committer | Shauren <shauren.trinity@gmail.com> | 2021-12-13 00:42:20 +0100 |
commit | 4e6c59dca78ce563c327ea3106d0ff6786b1e127 (patch) | |
tree | 11baa861d6e0eda35d4d73feba91a79c1bae788d /src/server/game/Conditions/ConditionMgr.cpp | |
parent | b8d675eba761a5616c7d69a78851ea61af61f4f6 (diff) |
Core/Unit: rename several getters to follow codestyle
uint8 GetLevel()
uint8 GetLevelForTarget(WorldObject const* /*target*/)
void SetLevel(uint8 lvl)
uint8 GetRace()
uint32 GetRaceMask()
uint8 GetClass()
uint32 GetClassMask()
uint8 GetGender()
(cherry picked from commit 5c09ff51f7015b775def8d5cc1f678eaef37200f)
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index b59fd335112..d641f70fb6f 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -210,19 +210,19 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const case CONDITION_CLASS: { if (Unit* unit = object->ToUnit()) - condMeets = (unit->getClassMask() & ConditionValue1) != 0; + condMeets = (unit->GetClassMask() & ConditionValue1) != 0; break; } case CONDITION_RACE: { if (Unit* unit = object->ToUnit()) - condMeets = Trinity::RaceMask<uint32>{ ConditionValue1 }.HasRace(unit->getRace()); + condMeets = Trinity::RaceMask<uint32>{ ConditionValue1 }.HasRace(unit->GetRace()); break; } case CONDITION_GENDER: { if (Player* player = object->ToPlayer()) - condMeets = player->getGender() == ConditionValue1; + condMeets = player->GetGender() == ConditionValue1; break; } case CONDITION_SKILL: @@ -308,7 +308,7 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const case CONDITION_LEVEL: { if (Unit* unit = object->ToUnit()) - condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue2), static_cast<uint32>(unit->getLevel()), ConditionValue1); + condMeets = CompareValues(static_cast<ComparisionType>(ConditionValue2), static_cast<uint32>(unit->GetLevel()), ConditionValue1); break; } case CONDITION_DRUNKENSTATE: @@ -2654,7 +2654,7 @@ uint32 ConditionMgr::GetPlayerConditionLfgValue(Player const* player, PlayerCond if (!selectedRandomDungeon) return 0; - if (lfg::LfgReward const* reward = sLFGMgr->GetRandomDungeonReward(selectedRandomDungeon, player->getLevel())) + if (lfg::LfgReward const* reward = sLFGMgr->GetRandomDungeonReward(selectedRandomDungeon, player->GetLevel())) if (Quest const* quest = sObjectMgr->GetQuestTemplate(reward->firstQuest)) if (player->CanRewardQuest(quest, false)) return 1; @@ -2688,29 +2688,29 @@ bool ConditionMgr::IsPlayerMeetingCondition(Player const* player, PlayerConditio if (condition->Flags & 0x80) { - if (minLevel && player->getLevel() >= minLevel && (!maxLevel || player->getLevel() <= maxLevel)) + if (minLevel && player->GetLevel() >= minLevel && (!maxLevel || player->GetLevel() <= maxLevel)) return false; - if (maxLevel && player->getLevel() <= maxLevel && (!minLevel || player->getLevel() >= minLevel)) + if (maxLevel && player->GetLevel() <= maxLevel && (!minLevel || player->GetLevel() >= minLevel)) return false; } else { - if (minLevel && player->getLevel() < minLevel) + if (minLevel && player->GetLevel() < minLevel) return false; - if (maxLevel && player->getLevel() > maxLevel) + if (maxLevel && player->GetLevel() > maxLevel) return false; } } - if (condition->RaceMask && !condition->RaceMask.HasRace(player->getRace())) + if (condition->RaceMask && !condition->RaceMask.HasRace(player->GetRace())) return false; - if (condition->ClassMask && !(player->getClassMask() & condition->ClassMask)) + if (condition->ClassMask && !(player->GetClassMask() & condition->ClassMask)) return false; - if (condition->Gender >= 0 && player->getGender() != condition->Gender) + if (condition->Gender >= 0 && player->GetGender() != condition->Gender) return false; if (condition->NativeGender >= 0 && player->GetNativeSex() != condition->NativeGender) |