Sprite Movement working with AI movement (#33494)

* FINALLY

* Update animals.yml
This commit is contained in:
Ed
2024-12-18 19:15:34 +03:00
committed by GitHub
parent b649517a17
commit 18fe8b9df0
10 changed files with 182 additions and 115 deletions

View File

@@ -0,0 +1,23 @@
using Content.Shared.Movement.Components;
using Content.Shared.Movement.Events;
namespace Content.Shared.Movement.Systems;
public abstract class SharedSpriteMovementSystem : EntitySystem
{
public override void Initialize()
{
base.Initialize();
SubscribeLocalEvent<SpriteMovementComponent, SpriteMoveEvent>(OnSpriteMoveInput);
}
private void OnSpriteMoveInput(Entity<SpriteMovementComponent> ent, ref SpriteMoveEvent args)
{
if (ent.Comp.IsMoving == args.IsMoving)
return;
ent.Comp.IsMoving = args.IsMoving;
Dirty(ent);
}
}