From d85379faa6d5d33f755e17cb0204f243345db938 Mon Sep 17 00:00:00 2001 From: Shauren Date: Sun, 19 Jun 2022 15:02:25 +0200 Subject: Core/Transports: Fixed stoppable elevator position calculation when going from first floor to third or higher --- src/server/game/Entities/GameObject/GameObject.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3