Skip to content

Commit 8ec7599

Browse files
committed
fix: improve entity rendering order determination while moving
1 parent 1459a02 commit 8ec7599

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

Intersect.Client.Core/Entities/Entity.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1179,7 +1179,14 @@ public virtual bool ShouldDrawName
11791179
entityY = MapHeight * 3 + Y;
11801180
}
11811181

1182-
entityY = (int)Math.Floor(entityY + OffsetY / TileHeight);
1182+
if (IsMoving && DirectionMoving == Direction.Up || DirectionMoving == Direction.UpLeft || DirectionMoving == Direction.UpRight)
1183+
{
1184+
entityY = entityY - 1;
1185+
}
1186+
else if (IsMoving && DirectionMoving == Direction.Down || DirectionMoving == Direction.DownLeft || DirectionMoving == Direction.DownRight)
1187+
{
1188+
entityY = entityY + 1;
1189+
}
11831190

11841191
if (priority >= renderingEntities.GetLength(0) || entityY >= renderingEntities.GetLength(1))
11851192
{

0 commit comments

Comments
 (0)