Content changes required for recursive deletion changes (#9316)

This commit is contained in:
Leon Friedrich
2022-07-08 06:30:02 +12:00
committed by GitHub
parent 6eba481657
commit dc38cc6074
3 changed files with 19 additions and 8 deletions

View File

@@ -24,10 +24,8 @@ namespace Content.Server.Buckle.Systems
SubscribeLocalEvent<StrapComponent, RotateEvent>(RotateEvent);
SubscribeLocalEvent<BuckleComponent, EntInsertedIntoContainerMessage>(ContainerModifiedBuckle);
SubscribeLocalEvent<StrapComponent, EntInsertedIntoContainerMessage>(ContainerModifiedStrap);
SubscribeLocalEvent<BuckleComponent, EntRemovedFromContainerMessage>(ContainerModifiedBuckle);
SubscribeLocalEvent<StrapComponent, EntRemovedFromContainerMessage>(ContainerModifiedStrap);
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)
{
foreach (var buckledEntity in strap.BuckledEntities)

View File

@@ -21,11 +21,21 @@ namespace Content.Server.Gravity.EntitySystems
SubscribeLocalEvent<GravityGeneratorComponent, ComponentInit>(OnComponentInitialized);
SubscribeLocalEvent<GravityGeneratorComponent, ComponentShutdown>(OnComponentShutdown);
SubscribeLocalEvent<GravityGeneratorComponent, EntParentChangedMessage>(OnParentChanged); // Or just anchor changed?
SubscribeLocalEvent<GravityGeneratorComponent, InteractHandEvent>(OnInteractHand);
SubscribeLocalEvent<GravityGeneratorComponent, SharedGravityGeneratorComponent.SwitchGeneratorMessage>(
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)
{
component.GravityActive = false;

View File

@@ -1,8 +1,9 @@
using Content.Shared.Database;
using Content.Shared.Database;
using Content.Shared.Follower.Components;
using Content.Shared.Ghost;
using Content.Shared.Movement.Events;
using Content.Shared.Verbs;
using Robust.Shared.Map;
namespace Content.Shared.Follower;
@@ -100,7 +101,13 @@ public sealed class FollowerSystem : EntitySystem
RemComp<FollowedComponent>(target);
RemComp<FollowerComponent>(uid);
Transform(uid).AttachToGridOrMap();
var xform = Transform(uid);
xform.AttachToGridOrMap();
if (xform.MapID == MapId.Nullspace)
{
Del(uid);
return;
}
RemComp<OrbitVisualsComponent>(uid);