Core/Transports: Fixed event timestamps for edge cases

Port From (https://github.com/TrinityCore/TrinityCore/commit/5872f032c906bdee5f292919808bd221994fad5e)
This commit is contained in:
Hondacrx
2024-11-11 21:17:57 -05:00
parent 7a50f06e8c
commit 76b0d747d3
+5 -5
View File
@@ -219,7 +219,7 @@ namespace Game.Maps
if (pathPoints[eventPointIndex].ArrivalEventID != 0) if (pathPoints[eventPointIndex].ArrivalEventID != 0)
{ {
TransportPathEvent Event = new(); TransportPathEvent Event = new();
Event.Timestamp = totalTime + eventSplineTime + leg.Duration; Event.Timestamp = totalTime + eventSplineTime + leg.Duration + delaySum;
Event.EventId = pathPoints[eventPointIndex].ArrivalEventID; Event.EventId = pathPoints[eventPointIndex].ArrivalEventID;
outEvents.Add(Event); outEvents.Add(Event);
} }
@@ -227,7 +227,7 @@ namespace Game.Maps
if (pathPoints[eventPointIndex].DepartureEventID != 0) if (pathPoints[eventPointIndex].DepartureEventID != 0)
{ {
TransportPathEvent Event = new(); 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; Event.EventId = pathPoints[eventPointIndex].DepartureEventID;
outEvents.Add(Event); outEvents.Add(Event);
} }
@@ -269,7 +269,7 @@ namespace Game.Maps
if (pathPoints[eventPointIndex].ArrivalEventID != 0) if (pathPoints[eventPointIndex].ArrivalEventID != 0)
{ {
TransportPathEvent Event = new(); TransportPathEvent Event = new();
Event.Timestamp = totalTime + eventSplineTime + leg.Duration; Event.Timestamp = totalTime + eventSplineTime + leg.Duration + delaySum;
Event.EventId = pathPoints[eventPointIndex].ArrivalEventID; Event.EventId = pathPoints[eventPointIndex].ArrivalEventID;
outEvents.Add(Event); outEvents.Add(Event);
} }
@@ -277,7 +277,7 @@ namespace Game.Maps
if (pathPoints[eventPointIndex].DepartureEventID != 0) if (pathPoints[eventPointIndex].DepartureEventID != 0)
{ {
TransportPathEvent Event = new(); TransportPathEvent Event = new();
Event.Timestamp = totalTime + eventSplineTime + leg.Duration; Event.Timestamp = totalTime + eventSplineTime + leg.Duration + delaySum;
Event.EventId = pathPoints[eventPointIndex].DepartureEventID; Event.EventId = pathPoints[eventPointIndex].DepartureEventID;
outEvents.Add(Event); outEvents.Add(Event);
} }
@@ -360,7 +360,7 @@ namespace Game.Maps
transport.TotalPathTime = totalTime; transport.TotalPathTime = totalTime;
} }
public void AddPathNodeToTransport(uint transportEntry, uint timeSeg, TransportAnimationRecord node) public void AddPathNodeToTransport(uint transportEntry, uint timeSeg, TransportAnimationRecord node)
{ {
if (!_transportAnimations.ContainsKey(transportEntry)) if (!_transportAnimations.ContainsKey(transportEntry))