Fix actions not being usable, ordering, and containers (#19964)

This commit is contained in:
DrSmugleaf
2023-09-09 16:14:17 -07:00
committed by GitHub
parent 7b41f7451c
commit 09bce85f19
21 changed files with 166 additions and 119 deletions

View File

@@ -1,4 +1,5 @@
using Content.Shared.Actions;
using Robust.Shared.Network;
using Robust.Shared.Random;
namespace Content.Shared.Spider;
@@ -6,6 +7,7 @@ namespace Content.Shared.Spider;
public abstract class SharedSpiderSystem : EntitySystem
{
[Dependency] private readonly SharedActionsSystem _action = default!;
[Dependency] private readonly INetManager _net = default!;
[Dependency] private readonly IRobustRandom _robustRandom = default!;
[Dependency] private readonly SharedAppearanceSystem _appearance = default!;
@@ -13,12 +15,15 @@ public abstract class SharedSpiderSystem : EntitySystem
{
base.Initialize();
SubscribeLocalEvent<SpiderComponent, MapInitEvent>(OnSpiderMapInit);
SubscribeLocalEvent<SpiderComponent, ComponentStartup>(OnSpiderStartup);
SubscribeLocalEvent<SpiderWebObjectComponent, ComponentStartup>(OnWebStartup);
}
private void OnSpiderMapInit(EntityUid uid, SpiderComponent component, MapInitEvent args)
private void OnSpiderStartup(EntityUid uid, SpiderComponent component, ComponentStartup args)
{
if (_net.IsClient)
return;
_action.AddAction(uid, Spawn(component.WebAction), null);
}