Skip to content

Commit

Permalink
fix: please I beg you
Browse files Browse the repository at this point in the history
Signed-off-by: Remuchi <[email protected]>
  • Loading branch information
Remuchi committed Dec 11, 2024
1 parent bca8d8f commit dfe8fc9
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 17 deletions.
24 changes: 11 additions & 13 deletions Content.Server/WhiteDream/BloodCult/Constructs/ConstructSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ public override void Initialize()
{
base.Initialize();

SubscribeLocalEvent<ConstructComponent, ComponentStartup>(OnComponentStartup);
SubscribeLocalEvent<ConstructComponent, MapInitEvent>(OnMapInit);
SubscribeLocalEvent<ConstructComponent, ComponentShutdown>(OnComponentShutdown);
}

Expand All @@ -39,30 +39,28 @@ public override void Update(float frameTime)
}
}

private void OnComponentStartup(Entity<ConstructComponent> ent, ref ComponentStartup args)
private void OnMapInit(Entity<ConstructComponent> construct, ref MapInitEvent args)
{
foreach (var actionId in ent.Comp.Actions)
foreach (var actionId in construct.Comp.Actions)
{
var action = _actions.AddAction(ent, actionId);
ent.Comp.ActionEntities.Add(action);
var action = _actions.AddAction(construct, actionId);
construct.Comp.ActionEntities.Add(action);
}

_appearanceSystem.SetData(ent, ConstructVisualsState.Transforming, true);
ent.Comp.Transforming = true;
_appearanceSystem.SetData(construct, ConstructVisualsState.Transforming, true);
construct.Comp.Transforming = true;
var cultistRule = EntityManager.EntityQueryEnumerator<BloodCultRuleComponent>();
while (cultistRule.MoveNext(out _, out var rule))
rule.Constructs.Add(ent);
rule.Constructs.Add(construct);
}

private void OnComponentShutdown(Entity<ConstructComponent> ent, ref ComponentShutdown args)
private void OnComponentShutdown(Entity<ConstructComponent> construct, ref ComponentShutdown args)
{
foreach (var actionEntity in ent.Comp.ActionEntities)
{
foreach (var actionEntity in construct.Comp.ActionEntities)
_actions.RemoveAction(actionEntity);
}

var cultistRule = EntityManager.EntityQueryEnumerator<BloodCultRuleComponent>();
while (cultistRule.MoveNext(out _, out var rule))
rule.Constructs.Remove(ent);
rule.Constructs.Remove(construct);
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -83,10 +83,6 @@
proto: guardian
- type: Puller
needsHands: false
- type: ActionsContainer
- type: ContainerContainer
containers:
actions: !type:Container
- type: Visibility
- type: ContentEye
- type: Actions
Expand Down

0 comments on commit dfe8fc9

Please sign in to comment.