Core/Transports: Fixed stoppable elevator position calculation when going from first floor to third or higher

Port From (https://github.com/TrinityCore/TrinityCore/commit/d85379faa6d5d33f755e17cb0204f243345db938)
This commit is contained in:
hondacrx
2022-06-20 22:48:42 -04:00
parent f38dee890d
commit be8e18450e
2 changed files with 6 additions and 2 deletions
@@ -3823,7 +3823,12 @@ namespace Game.Entities
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(GameObjectDynamicLowFlags.InvertedMovement);
else
_owner.RemoveDynamicFlag(GameObjectDynamicLowFlags.InvertedMovement);