diff options
author | ModoX <moardox@gmail.com> | 2023-07-21 17:54:27 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2023-07-21 17:54:27 +0200 |
commit | f28b4eed3d875ccedde574b0abc7258290b4c0a3 (patch) | |
tree | fc70c493d5b7947b4bb8b95af97a38b46be75536 /src/server/game/Conditions | |
parent | ac48da6275821f8f94acb6fb259728e6bf6fd79c (diff) |
Core/Condition: Implemented condition CONDITION_PRIVATE_OBJECT (#29136)
Diffstat (limited to 'src/server/game/Conditions')
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 9 | ||||
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.h | 1 |
2 files changed, 10 insertions, 0 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index 724d1eda5c3..cdcb7e18527 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -629,6 +629,11 @@ bool Condition::Meets(ConditionSourceInfo& sourceInfo) const condMeets = ConditionMgr::IsPlayerMeetingCondition(player, playerCondition); break; } + case CONDITION_PRIVATE_OBJECT: + { + condMeets = !object->GetPrivateObjectOwner().IsEmpty(); + break; + } default: break; } @@ -841,6 +846,9 @@ uint32 Condition::GetSearcherTypeMaskForCondition() const case CONDITION_PLAYER_CONDITION: mask |= GRID_MAP_TYPE_MASK_PLAYER; break; + case CONDITION_PRIVATE_OBJECT: + mask |= GRID_MAP_TYPE_MASK_ALL & ~GRID_MAP_TYPE_MASK_PLAYER; + break; default: ABORT_MSG("Condition::GetSearcherTypeMaskForCondition - missing condition handling!"); break; @@ -2697,6 +2705,7 @@ bool ConditionMgr::isConditionTypeValid(Condition* cond) const case CONDITION_CHARMED: case CONDITION_TAXI: case CONDITION_GAMEMASTER: + case CONDITION_PRIVATE_OBJECT: break; case CONDITION_DIFFICULTY_ID: if (!sDifficultyStore.LookupEntry(cond->ConditionValue1)) diff --git a/src/server/game/Conditions/ConditionMgr.h b/src/server/game/Conditions/ConditionMgr.h index d4652329faa..e7e94cc3a54 100644 --- a/src/server/game/Conditions/ConditionMgr.h +++ b/src/server/game/Conditions/ConditionMgr.h @@ -114,6 +114,7 @@ enum ConditionTypes CONDITION_SCENARIO_STEP = 54, // ScenarioStepId 0 0 true if player is at scenario with current step equal to ScenarioStepID CONDITION_SCENE_IN_PROGRESS = 55, // SceneScriptPackageId 0 0 true if player is playing a scene with ScriptPackageId equal to given value CONDITION_PLAYER_CONDITION = 56, // PlayerConditionId 0 0 true if player satisfies PlayerCondition + CONDITION_PRIVATE_OBJECT = 57, // 0 0 0 true if entity is private object CONDITION_MAX }; |