Skip to content
This repository was archived by the owner on Sep 15, 2024. It is now read-only.

Commit d279d90

Browse files
Only move to server position if > 100
1 parent 5569cc1 commit d279d90

1 file changed

Lines changed: 3 additions & 1 deletion

File tree

Scripts/Netcode/Common/SPacketEnemyPositions.cs

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,9 @@ public override async Task Handle()
4747

4848
foreach (var pair in Enemies)
4949
{
50-
sceneGameScript.Enemies[pair.Key].Position = pair.Value.Position;
50+
var enemy = sceneGameScript.Enemies[pair.Key];
51+
if (enemy.Position.DistanceTo(pair.Value.Position) > 100)
52+
sceneGameScript.Enemies[pair.Key].Position = pair.Value.Position;
5153
}
5254

5355
await Task.FromResult(1);

0 commit comments

Comments
 (0)