follow on use inhand (#606)

This commit is contained in:
A.Ne.
2024-11-24 15:36:35 +04:00
committed by GitHub
parent 897a9cf683
commit dbc2fd689a
3 changed files with 29 additions and 1 deletions

View File

@@ -0,0 +1,20 @@
using Content.Shared.Follower;
using Content.Shared.Interaction.Events;
namespace Content.Shared._CP14.Follower;
public partial class CP14FollowOnUseInHandSystem : EntitySystem
{
[Dependency] private readonly FollowerSystem _followerSystem = default!;
public override void Initialize()
{
SubscribeLocalEvent<CP14FollowOnUseInHandComponent, UseInHandEvent>(OnUseInHand);
}
private void OnUseInHand(EntityUid uid, CP14FollowOnUseInHandComponent component, UseInHandEvent args)
{
_followerSystem.StartFollowingEntity(uid, args.User);
}
}