From 4fea5e1b1ee1ed63fdd9eef03de7df322645efb5 Mon Sep 17 00:00:00 2001 From: hondacrx Date: Mon, 1 Aug 2022 17:46:11 -0400 Subject: [PATCH] Fixes when getting on some transports the npcs around you would disappear, and sometimes you would die from fall damage. --- Source/Game/Entities/Object/Position.cs | 4 ++-- Source/Game/Maps/TransportManager.cs | 7 ++----- 2 files changed, 4 insertions(+), 7 deletions(-) diff --git a/Source/Game/Entities/Object/Position.cs b/Source/Game/Entities/Object/Position.cs index c0dbcf2fe..a6c2e8876 100644 --- a/Source/Game/Entities/Object/Position.cs +++ b/Source/Game/Entities/Object/Position.cs @@ -216,8 +216,8 @@ namespace Game.Entities } public float GetExactDist2dSq(Position pos) { - float dx = posX - pos.posX; - float dy = posY - pos.posY; + float dx = pos.posX - posX; + float dy = pos.posY - posY; return dx * dx + dy * dy; } diff --git a/Source/Game/Maps/TransportManager.cs b/Source/Game/Maps/TransportManager.cs index 6ab6defff..0b49d9bf9 100644 --- a/Source/Game/Maps/TransportManager.cs +++ b/Source/Game/Maps/TransportManager.cs @@ -315,10 +315,7 @@ namespace Game.Maps totalTime += leg.Segments[pauseItr].SegmentEndArrivalTimestamp + leg.Segments[pauseItr].Delay; for (var i = 0; i < leg.Segments.Count; ++i) - { - var segment = leg.Segments[i]; - segment.SegmentEndArrivalTimestamp += leg.StartTimestamp; - } + leg.Segments[i].SegmentEndArrivalTimestamp += leg.StartTimestamp; } void GeneratePath(GameObjectTemplate goInfo, TransportTemplate transport) @@ -506,7 +503,7 @@ namespace Game.Maps Dictionary _transportSpawns = new(); } - public struct TransportPathSegment + public class TransportPathSegment { public uint SegmentEndArrivalTimestamp; public uint Delay;