aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorShauren <shauren.trinity@gmail.com>2022-06-19 15:02:25 +0200
committerShauren <shauren.trinity@gmail.com>2022-06-19 15:02:25 +0200
commitd85379faa6d5d33f755e17cb0204f243345db938 (patch)
tree50dceb69cdb5562433732d8f574b18e2d711523c /src
parent1043911410c2fd7623ceb51580825915e7426948 (diff)
Core/Transports: Fixed stoppable elevator position calculation when going from first floor to third or higher
Diffstat (limited to 'src')
-rw-r--r--src/server/game/Entities/GameObject/GameObject.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/server/game/Entities/GameObject/GameObject.cpp b/src/server/game/Entities/GameObject/GameObject.cpp
index 33f7e257a28..ccc8c38ba1a 100644
--- a/src/server/game/Entities/GameObject/GameObject.cpp
+++ b/src/server/game/Entities/GameObject/GameObject.cpp
@@ -373,7 +373,12 @@ public:
if (oldToNewStateDelta < 0)
oldToNewStateDelta += pauseTimesCount + 1;
- if (oldToNewStateDelta < newToOldStateDelta)
+ // this additional check is neccessary because client doesn't check dynamic flags on progress update
+ // instead it multiplies progress from dynamicflags field by -1 and then compares that against 0
+ // when calculating path progress while we simply check the flag if (!_owner.HasDynamicFlag(GO_DYNFLAG_LO_INVERTED_MOVEMENT))
+ bool isAtStartOfPath = _stateChangeProgress == 0;
+
+ if (oldToNewStateDelta < newToOldStateDelta && !isAtStartOfPath)
_owner.SetDynamicFlag(GO_DYNFLAG_LO_INVERTED_MOVEMENT);
else
_owner.RemoveDynamicFlag(GO_DYNFLAG_LO_INVERTED_MOVEMENT);