From 8e4d5bb16949f81aa2e5acb71c2c549070c221cc Mon Sep 17 00:00:00 2001 From: Kamron Batman <3953314+kamronbatman@users.noreply.github.com> Date: Sun, 3 Oct 2021 19:19:26 -0700 Subject: [PATCH] fix: Fixes movement issue (#814) * Fixes wrong item list used for item detection --- Projects/Server/TileData.cs | 1 + Projects/UOContent/Engines/Pathing/Movement.cs | 13 +++++++------ 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/Projects/Server/TileData.cs b/Projects/Server/TileData.cs index a566368c7..6e2b66aaf 100644 --- a/Projects/Server/TileData.cs +++ b/Projects/Server/TileData.cs @@ -150,6 +150,7 @@ namespace Server { [MethodImpl(MethodImplOptions.AggressiveInlining)] get => this[TileFlag.Impassable | TileFlag.Surface]; + set => this[TileFlag.Impassable | TileFlag.Surface] = value; } [CommandProperty(AccessLevel.GameMaster, AccessLevel.Administrator)] diff --git a/Projects/UOContent/Engines/Pathing/Movement.cs b/Projects/UOContent/Engines/Pathing/Movement.cs index b5b3665ad..8ce683ad9 100644 --- a/Projects/UOContent/Engines/Pathing/Movement.cs +++ b/Projects/UOContent/Engines/Pathing/Movement.cs @@ -212,10 +212,14 @@ namespace Server.Movement continue; } - if (item.AtWorldPoint(xStart, yStart) || sectorStartIsForward && item.AtWorldPoint(xForward, yForward)) + if (item.AtWorldPoint(xStart, yStart)) { itemsStart.Add(item); } + else if (sectorStartIsForward && item.AtWorldPoint(xForward, yForward)) + { + itemsForward.Add(item); + } } if (checkMobs) @@ -619,10 +623,9 @@ namespace Server.Movement { var tile = staticTiles[i]; var id = TileData.ItemTable[tile.ID & TileData.MaxItemValue]; - var calcTop = tile.Z + id.CalcHeight; - if (isSet && calcTop < zCenter || !id.Surface && !(m.CanSwim && id.Wet) || loc.Z < calcTop) + if (isSet && calcTop < zCenter || loc.Z < calcTop || !id.Surface && !(m.CanSwim && id.Wet)) { continue; } @@ -648,12 +651,10 @@ namespace Server.Movement for (var i = 0; i < itemList.Count; ++i) { var item = itemList[i]; - var id = item.ItemData; - var calcTop = item.Z + id.CalcHeight; - if (isSet && calcTop < zCenter || !id.Surface && !(m.CanSwim && id.Wet) || loc.Z < calcTop) + if (isSet && calcTop < zCenter || loc.Z < calcTop || !id.Surface && !(m.CanSwim && id.Wet)) { continue; }