diff options
author | ForesterDev <11771800+ForesterDev@users.noreply.github.com> | 2019-03-23 20:51:36 +0400 |
---|---|---|
committer | Giacomo Pozzoni <giacomopoz@gmail.com> | 2019-03-23 17:51:36 +0100 |
commit | 262ddaf819d3b2e759bb4690149c0c28a4022d5f (patch) | |
tree | b445c57fcee01407a77c2de55ed972b2c7793e88 /src/server/game/Conditions/ConditionMgr.cpp | |
parent | a926a3088d39897fe3ab58239775661449498363 (diff) |
Core/Conditions: implement CONDITION_GAMEMASTER (#23108)
Diffstat (limited to 'src/server/game/Conditions/ConditionMgr.cpp')
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 44c4e1f1a02..9e382a03b5e 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -499,6 +499,17 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const } break; } + case CONDITION_GAMEMASTER: + { + if (Player* player = object->ToPlayer()) + { + if (ConditionValue1 == 1) + condMeets = player->CanBeGameMaster(); + else + condMeets = player->IsGameMaster(); + } + break; + } default: condMeets = false; break; @@ -686,6 +697,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition() const case CONDITION_QUESTSTATE: mask |= GRID_MAP_TYPE_MASK_PLAYER; break; + case CONDITION_GAMEMASTER: + mask |= GRID_MAP_TYPE_MASK_PLAYER; + break; default: ASSERT(false && "Condition::GetSearcherTypeMaskForCondition - missing condition handling!"); break; @@ -2259,6 +2273,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const case CONDITION_IN_WATER: case CONDITION_CHARMED: case CONDITION_TAXI: + case CONDITION_GAMEMASTER: default: break; } |