diff options
author | ModoX <moardox@gmail.com> | 2023-11-26 22:19:05 +0100 |
---|---|---|
committer | ModoX <moardox@gmail.com> | 2023-11-26 22:19:23 +0100 |
commit | b1c5e3809ca92ba6f172fefd9711788a7b2a8df8 (patch) | |
tree | 06f97e7ea58270e83d1e3e4588284e265547f476 /src | |
parent | 5a126f8852a3e56f29177dec241ad48bf880a132 (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
Diffstat (limited to 'src')
-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 d0c4b1a3e7d..66f52357f19 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; } |