refactor: entity packets now directly go into the target entity

This commit is contained in:
2025-05-26 21:58:05 +03:00
parent 12f4950ffb
commit 29829bbaa6
2 changed files with 39 additions and 19 deletions

View File

@@ -80,11 +80,9 @@ public class PaddleBehaviour(Keys Up, Keys Down, float High, float Low, float Sp
public void OnClientPacketArrived(PaddleKeyStatePacket packet)
{
if (packet.EntityId.CompareTo(Id) != 0)
return;
isUpPressed = packet.IsUpPressed;
isDownPressed = packet.IsDownPressed;
if (!isUpPressed && !isDownPressed)
Transform.Position.TweenVector2D(tweenManager, .05f, packet.Position, x => Transform.Position = x);
else