Allow containment field generators to be enabled on mapinit (#31158)
* Initial commit * review fix
This commit is contained in:
@@ -37,6 +37,7 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem
|
||||
SubscribeLocalEvent<ContainmentFieldGeneratorComponent, UnanchorAttemptEvent>(OnUnanchorAttempt);
|
||||
SubscribeLocalEvent<ContainmentFieldGeneratorComponent, ComponentRemove>(OnComponentRemoved);
|
||||
SubscribeLocalEvent<ContainmentFieldGeneratorComponent, EventHorizonAttemptConsumeEntityEvent>(PreventBreach);
|
||||
SubscribeLocalEvent<ContainmentFieldGeneratorComponent, MapInitEvent>(OnMapInit);
|
||||
}
|
||||
|
||||
public override void Update(float frameTime)
|
||||
@@ -61,6 +62,12 @@ public sealed class ContainmentFieldGeneratorSystem : EntitySystem
|
||||
|
||||
#region Events
|
||||
|
||||
private void OnMapInit(Entity<ContainmentFieldGeneratorComponent> generator, ref MapInitEvent args)
|
||||
{
|
||||
if (generator.Comp.Enabled)
|
||||
ChangeFieldVisualizer(generator);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// A generator receives power from a source colliding with it.
|
||||
/// </summary>
|
||||
|
||||
Reference in New Issue
Block a user