From 76b0d747d3cc6833652434707d45e07c2690279e Mon Sep 17 00:00:00 2001 From: Hondacrx Date: Mon, 11 Nov 2024 21:17:57 -0500 Subject: [PATCH] Core/Transports: Fixed event timestamps for edge cases Port From (https://github.com/TrinityCore/TrinityCore/commit/5872f032c906bdee5f292919808bd221994fad5e) --- Source/Game/Maps/TransportManager.cs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/Source/Game/Maps/TransportManager.cs b/Source/Game/Maps/TransportManager.cs index 19bd4208f..eedb85113 100644 --- a/Source/Game/Maps/TransportManager.cs +++ b/Source/Game/Maps/TransportManager.cs @@ -219,7 +219,7 @@ namespace Game.Maps if (pathPoints[eventPointIndex].ArrivalEventID != 0) { TransportPathEvent Event = new(); - Event.Timestamp = totalTime + eventSplineTime + leg.Duration; + Event.Timestamp = totalTime + eventSplineTime + leg.Duration + delaySum; Event.EventId = pathPoints[eventPointIndex].ArrivalEventID; outEvents.Add(Event); } @@ -227,7 +227,7 @@ namespace Game.Maps if (pathPoints[eventPointIndex].DepartureEventID != 0) { TransportPathEvent Event = new(); - Event.Timestamp = totalTime + eventSplineTime + leg.Duration + (pausePointIndex == eventPointIndex ? pathPoints[eventPointIndex].Delay * Time.InMilliseconds : 0); + Event.Timestamp = totalTime + eventSplineTime + leg.Duration + delaySum + (pausePointIndex == eventPointIndex ? pathPoints[eventPointIndex].Delay * Time.InMilliseconds : 0); Event.EventId = pathPoints[eventPointIndex].DepartureEventID; outEvents.Add(Event); } @@ -269,7 +269,7 @@ namespace Game.Maps if (pathPoints[eventPointIndex].ArrivalEventID != 0) { TransportPathEvent Event = new(); - Event.Timestamp = totalTime + eventSplineTime + leg.Duration; + Event.Timestamp = totalTime + eventSplineTime + leg.Duration + delaySum; Event.EventId = pathPoints[eventPointIndex].ArrivalEventID; outEvents.Add(Event); } @@ -277,7 +277,7 @@ namespace Game.Maps if (pathPoints[eventPointIndex].DepartureEventID != 0) { TransportPathEvent Event = new(); - Event.Timestamp = totalTime + eventSplineTime + leg.Duration; + Event.Timestamp = totalTime + eventSplineTime + leg.Duration + delaySum; Event.EventId = pathPoints[eventPointIndex].DepartureEventID; outEvents.Add(Event); } @@ -360,7 +360,7 @@ namespace Game.Maps transport.TotalPathTime = totalTime; } - + public void AddPathNodeToTransport(uint transportEntry, uint timeSeg, TransportAnimationRecord node) { if (!_transportAnimations.ContainsKey(transportEntry))