aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorForesterDev <11771800+ForesterDev@users.noreply.github.com>2019-03-23 20:51:36 +0400
committerGiacomo Pozzoni <giacomopoz@gmail.com>2019-03-23 17:51:36 +0100
commit262ddaf819d3b2e759bb4690149c0c28a4022d5f (patch)
treeb445c57fcee01407a77c2de55ed972b2c7793e88
parenta926a3088d39897fe3ab58239775661449498363 (diff)
Core/Conditions: implement CONDITION_GAMEMASTER (#23108)
-rw-r--r--src/server/game/Conditions/ConditionMgr.cpp15
-rw-r--r--src/server/game/Conditions/ConditionMgr.h3
2 files changed, 17 insertions, 1 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;
}
diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h
index caccc5595f1..d3e6b7824cd 100644
--- a/src/server/game/Conditions/ConditionMgr.h
+++ b/src/server/game/Conditions/ConditionMgr.h
@@ -82,7 +82,8 @@ enum ConditionTypes
CONDITION_PET_TYPE = 45, // mask 0 0 true if player has a pet of given type(s)
CONDITION_TAXI = 46, // 0 0 0 true if player is on taxi
CONDITION_QUESTSTATE = 47, // quest_id state_mask 0 true if player is in any of the provided quest states for the quest (1 = not taken, 2 = completed, 8 = in progress, 32 = failed, 64 = rewarded)
- CONDITION_MAX = 48 // MAX
+ CONDITION_GAMEMASTER = 48, // canBeGM 0 0 true if player is gamemaster (or can be gamemaster)
+ CONDITION_MAX = 49 // MAX
};
/*! Documentation on implementing a new ConditionSourceType: