fix: Fixes movement issue (#814)
* Fixes wrong item list used for item detection
This commit is contained in:
parent
a845f8a1c0
commit
8e4d5bb169
2 changed files with 8 additions and 6 deletions
|
|
@ -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)]
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue