diff options
author | ModoX <moardox@gmail.com> | 2023-11-26 22:19:05 +0100 |
---|---|---|
committer | funjoker <funjoker109@gmail.com> | 2023-12-01 23:29:27 +0100 |
commit | 0af520b10b98e3ae7b0d2d624d70de0ed7e66aff (patch) | |
tree | 6f87e6a92df8640654a3ec3f1a69700ae36f1bed | |
parent | fbe0ef9f32df5b11bc932e9cc747b60b1b81db33 (diff) |
Scripts/Conditions: Fallback to other targets to get map if first target is invalid
* fixes crash in Ulduar when reaching Assembly of Iron / Kologarn / Algalon area
(cherry picked from commit b1c5e3809ca92ba6f172fefd9711788a7b2a8df8)
-rw-r--r-- | src/server/game/Conditions/ConditionMgr.cpp | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/server/game/Conditions/ConditionMgr.cpp b/src/server/game/Conditions/ConditionMgr.cpp index a7a74704a5d..8f010caee88 100644 --- a/src/server/game/Conditions/ConditionMgr.cpp +++ b/src/server/game/Conditions/ConditionMgr.cpp @@ -161,7 +161,14 @@ ConditionSourceInfo::ConditionSourceInfo(WorldObject const* target0, WorldObject mConditionTargets[0] = target0; mConditionTargets[1] = target1; mConditionTargets[2] = target2; - mConditionMap = target0 ? target0->GetMap() : nullptr; + if (target0) + mConditionMap = target0->GetMap(); + else if (target1) + mConditionMap = target1->GetMap(); + else if (target2) + mConditionMap = target2->GetMap(); + else + mConditionMap = nullptr; mLastFailedCondition = nullptr; } |