Content changes required for recursive deletion changes (#9316)
This commit is contained in:
@@ -24,10 +24,8 @@ namespace Content.Server.Buckle.Systems
|
|||||||
|
|
||||||
SubscribeLocalEvent<StrapComponent, RotateEvent>(RotateEvent);
|
SubscribeLocalEvent<StrapComponent, RotateEvent>(RotateEvent);
|
||||||
|
|
||||||
SubscribeLocalEvent<BuckleComponent, EntInsertedIntoContainerMessage>(ContainerModifiedBuckle);
|
|
||||||
SubscribeLocalEvent<StrapComponent, EntInsertedIntoContainerMessage>(ContainerModifiedStrap);
|
SubscribeLocalEvent<StrapComponent, EntInsertedIntoContainerMessage>(ContainerModifiedStrap);
|
||||||
|
|
||||||
SubscribeLocalEvent<BuckleComponent, EntRemovedFromContainerMessage>(ContainerModifiedBuckle);
|
|
||||||
SubscribeLocalEvent<StrapComponent, EntRemovedFromContainerMessage>(ContainerModifiedStrap);
|
SubscribeLocalEvent<StrapComponent, EntRemovedFromContainerMessage>(ContainerModifiedStrap);
|
||||||
|
|
||||||
SubscribeLocalEvent<BuckleComponent, InteractHandEvent>(HandleInteractHand);
|
SubscribeLocalEvent<BuckleComponent, InteractHandEvent>(HandleInteractHand);
|
||||||
@@ -97,10 +95,6 @@ namespace Content.Server.Buckle.Systems
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void ContainerModifiedBuckle(EntityUid uid, BuckleComponent buckle, ContainerModifiedMessage message)
|
|
||||||
{
|
|
||||||
ContainerModifiedReAttach(buckle, buckle.BuckledTo);
|
|
||||||
}
|
|
||||||
private void ContainerModifiedStrap(EntityUid uid, StrapComponent strap, ContainerModifiedMessage message)
|
private void ContainerModifiedStrap(EntityUid uid, StrapComponent strap, ContainerModifiedMessage message)
|
||||||
{
|
{
|
||||||
foreach (var buckledEntity in strap.BuckledEntities)
|
foreach (var buckledEntity in strap.BuckledEntities)
|
||||||
|
|||||||
@@ -21,11 +21,21 @@ namespace Content.Server.Gravity.EntitySystems
|
|||||||
|
|
||||||
SubscribeLocalEvent<GravityGeneratorComponent, ComponentInit>(OnComponentInitialized);
|
SubscribeLocalEvent<GravityGeneratorComponent, ComponentInit>(OnComponentInitialized);
|
||||||
SubscribeLocalEvent<GravityGeneratorComponent, ComponentShutdown>(OnComponentShutdown);
|
SubscribeLocalEvent<GravityGeneratorComponent, ComponentShutdown>(OnComponentShutdown);
|
||||||
|
SubscribeLocalEvent<GravityGeneratorComponent, EntParentChangedMessage>(OnParentChanged); // Or just anchor changed?
|
||||||
SubscribeLocalEvent<GravityGeneratorComponent, InteractHandEvent>(OnInteractHand);
|
SubscribeLocalEvent<GravityGeneratorComponent, InteractHandEvent>(OnInteractHand);
|
||||||
SubscribeLocalEvent<GravityGeneratorComponent, SharedGravityGeneratorComponent.SwitchGeneratorMessage>(
|
SubscribeLocalEvent<GravityGeneratorComponent, SharedGravityGeneratorComponent.SwitchGeneratorMessage>(
|
||||||
OnSwitchGenerator);
|
OnSwitchGenerator);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void OnParentChanged(EntityUid uid, GravityGeneratorComponent component, ref EntParentChangedMessage args)
|
||||||
|
{
|
||||||
|
// TODO consider stations with more than one generator.
|
||||||
|
if (component.GravityActive && TryComp(args.OldParent, out GravityComponent? gravity))
|
||||||
|
_gravitySystem.DisableGravity(gravity);
|
||||||
|
|
||||||
|
UpdateGravityActive(component, false);
|
||||||
|
}
|
||||||
|
|
||||||
private void OnComponentShutdown(EntityUid uid, GravityGeneratorComponent component, ComponentShutdown args)
|
private void OnComponentShutdown(EntityUid uid, GravityGeneratorComponent component, ComponentShutdown args)
|
||||||
{
|
{
|
||||||
component.GravityActive = false;
|
component.GravityActive = false;
|
||||||
|
|||||||
@@ -1,8 +1,9 @@
|
|||||||
using Content.Shared.Database;
|
using Content.Shared.Database;
|
||||||
using Content.Shared.Follower.Components;
|
using Content.Shared.Follower.Components;
|
||||||
using Content.Shared.Ghost;
|
using Content.Shared.Ghost;
|
||||||
using Content.Shared.Movement.Events;
|
using Content.Shared.Movement.Events;
|
||||||
using Content.Shared.Verbs;
|
using Content.Shared.Verbs;
|
||||||
|
using Robust.Shared.Map;
|
||||||
|
|
||||||
namespace Content.Shared.Follower;
|
namespace Content.Shared.Follower;
|
||||||
|
|
||||||
@@ -100,7 +101,13 @@ public sealed class FollowerSystem : EntitySystem
|
|||||||
RemComp<FollowedComponent>(target);
|
RemComp<FollowedComponent>(target);
|
||||||
RemComp<FollowerComponent>(uid);
|
RemComp<FollowerComponent>(uid);
|
||||||
|
|
||||||
Transform(uid).AttachToGridOrMap();
|
var xform = Transform(uid);
|
||||||
|
xform.AttachToGridOrMap();
|
||||||
|
if (xform.MapID == MapId.Nullspace)
|
||||||
|
{
|
||||||
|
Del(uid);
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
RemComp<OrbitVisualsComponent>(uid);
|
RemComp<OrbitVisualsComponent>(uid);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user