From e5a6625fe4f4eb1a086fb98b4a2f04021cd0855d Mon Sep 17 00:00:00 2001 From: GreaseMonk <1354802+GreaseMonk@users.noreply.github.com> Date: Tue, 7 Jan 2025 17:01:29 +0100 Subject: [PATCH] Prevent player despawning on salvage and other debris (#2661) * Prevent piloting of debris etc * Fix unparenting * Update nf_bluespace_grids_events.yml * Update nf_bluespace_dungeons_events.yml * Update nf_bluespace_dungeons_events.yml * Update base_debris.yml --------- Co-authored-by: Dvir <39403717+dvir001@users.noreply.github.com> --- .../Worldgen/Systems/LocalityLoaderSystem.cs | 2 +- .../EventSystems/LinkedLifecycleGridSystem.cs | 4 ++-- .../_NF/Entities/World/Debris/base_debris.yml | 4 +++- .../Events/nf_bluespace_dungeons_events.yml | 1 + .../_NF/Events/nf_bluespace_grids_events.yml | 24 +++++++++++++++++++ .../Events/nf_bluespace_salvage_events.yml | 3 +++ 6 files changed, 34 insertions(+), 4 deletions(-) diff --git a/Content.Server/Worldgen/Systems/LocalityLoaderSystem.cs b/Content.Server/Worldgen/Systems/LocalityLoaderSystem.cs index 742b9687bfc..9a16ef7a4db 100644 --- a/Content.Server/Worldgen/Systems/LocalityLoaderSystem.cs +++ b/Content.Server/Worldgen/Systems/LocalityLoaderSystem.cs @@ -88,7 +88,7 @@ private void OnDebrisDespawn(EntityUid entity, SpaceDebrisComponent component, E } // Do not delete the grid, it is being deleted. - _linkedLifecycleGrid.UnparentPlayersFromGrid(entity, false); + _linkedLifecycleGrid.UnparentPlayersFromGrid(grid: entity, deleteGrid: false, ignoreLifeStage: true); } } // Frontier diff --git a/Content.Server/_NF/StationEvents/EventSystems/LinkedLifecycleGridSystem.cs b/Content.Server/_NF/StationEvents/EventSystems/LinkedLifecycleGridSystem.cs index d663831a4f1..e7f869d3efc 100644 --- a/Content.Server/_NF/StationEvents/EventSystems/LinkedLifecycleGridSystem.cs +++ b/Content.Server/_NF/StationEvents/EventSystems/LinkedLifecycleGridSystem.cs @@ -130,9 +130,9 @@ private void OnMasterRemoved(EntityUid uid, LinkedLifecycleGridParentComponent c } // Deletes a grid, reparenting every humanoid and player character that's on it. - public void UnparentPlayersFromGrid(EntityUid grid, bool deleteGrid) + public void UnparentPlayersFromGrid(EntityUid grid, bool deleteGrid, bool ignoreLifeStage = false) { - if (MetaData(grid).EntityLifeStage >= EntityLifeStage.Terminating) + if (!ignoreLifeStage && MetaData(grid).EntityLifeStage >= EntityLifeStage.Terminating) return; var reparentEntities = GetEntitiesToReparent(grid); diff --git a/Resources/Prototypes/_NF/Entities/World/Debris/base_debris.yml b/Resources/Prototypes/_NF/Entities/World/Debris/base_debris.yml index fe24ffd6c0a..06273f90cfa 100644 --- a/Resources/Prototypes/_NF/Entities/World/Debris/base_debris.yml +++ b/Resources/Prototypes/_NF/Entities/World/Debris/base_debris.yml @@ -6,5 +6,7 @@ - type: LocalityLoader - type: GCAbleObject queue: SpaceDebris + - type: LinkedLifecycleGridParent - type: ProtectedGrid - preventArtifactTriggers: true \ No newline at end of file + preventArtifactTriggers: true + - type: PreventPilot diff --git a/Resources/Prototypes/_NF/Events/nf_bluespace_dungeons_events.yml b/Resources/Prototypes/_NF/Events/nf_bluespace_dungeons_events.yml index fbaf8d45ee7..4abd96077dd 100644 --- a/Resources/Prototypes/_NF/Events/nf_bluespace_dungeons_events.yml +++ b/Resources/Prototypes/_NF/Events/nf_bluespace_dungeons_events.yml @@ -41,6 +41,7 @@ - type: LinkedLifecycleGridParent - type: ProtectedGrid preventArtifactTriggers: true + - type: PreventPilot protos: - NFVGRoidBasalt diff --git a/Resources/Prototypes/_NF/Events/nf_bluespace_grids_events.yml b/Resources/Prototypes/_NF/Events/nf_bluespace_grids_events.yml index 9ff65d1e4bf..6b849df3af1 100644 --- a/Resources/Prototypes/_NF/Events/nf_bluespace_grids_events.yml +++ b/Resources/Prototypes/_NF/Events/nf_bluespace_grids_events.yml @@ -32,6 +32,9 @@ angularDamping: 999999 linearDamping: 999999 - type: LinkedLifecycleGridParent + - type: ProtectedGrid + preventArtifactTriggers: true + - type: PreventPilot paths: - /Maps/_NF/Bluespace/cache.yml rewardAccounts: @@ -71,6 +74,9 @@ angularDamping: 999999 linearDamping: 999999 - type: LinkedLifecycleGridParent + - type: ProtectedGrid + preventArtifactTriggers: true + - type: PreventPilot paths: - /Maps/_NF/Bluespace/vault.yml rewardAccounts: @@ -111,6 +117,9 @@ angularDamping: 999999 linearDamping: 999999 - type: LinkedLifecycleGridParent + - type: ProtectedGrid + preventArtifactTriggers: true + - type: PreventPilot paths: - /Maps/_NF/Bluespace/vaultsmall.yml rewardAccounts: @@ -149,6 +158,9 @@ angularDamping: 999999 linearDamping: 999999 - type: LinkedLifecycleGridParent + - type: ProtectedGrid + preventArtifactTriggers: true + - type: PreventPilot paths: - /Maps/_NF/Bluespace/syndieftlintercept.yml @@ -185,6 +197,9 @@ angularDamping: 999999 linearDamping: 999999 - type: LinkedLifecycleGridParent + - type: ProtectedGrid + preventArtifactTriggers: true + - type: PreventPilot paths: - /Maps/_NF/Bluespace/wizardprobealt.yml @@ -221,6 +236,9 @@ angularDamping: 999999 linearDamping: 999999 - type: LinkedLifecycleGridParent + - type: ProtectedGrid + preventArtifactTriggers: true + - type: PreventPilot paths: - /Maps/_NF/Bluespace/bloodmoon.yml @@ -255,6 +273,9 @@ angularDamping: 999999 linearDamping: 999999 - type: LinkedLifecycleGridParent + - type: ProtectedGrid + preventArtifactTriggers: true + - type: PreventPilot paths: - /Maps/_NF/Bluespace/cave.yml @@ -286,5 +307,8 @@ addComponents: - type: IFF - type: LinkedLifecycleGridParent + - type: ProtectedGrid + preventArtifactTriggers: true + - type: PreventPilot paths: - /Maps/_NF/Bluespace/mcevent.yml diff --git a/Resources/Prototypes/_NF/Events/nf_bluespace_salvage_events.yml b/Resources/Prototypes/_NF/Events/nf_bluespace_salvage_events.yml index bd126439dfc..64609585209 100644 --- a/Resources/Prototypes/_NF/Events/nf_bluespace_salvage_events.yml +++ b/Resources/Prototypes/_NF/Events/nf_bluespace_salvage_events.yml @@ -27,6 +27,9 @@ - type: IFF color: "#AAAAAA" - type: LinkedLifecycleGridParent + - type: ProtectedGrid + preventArtifactTriggers: true + - type: PreventPilot paths: - /Maps/_NF/Shuttles/Scrap/bison.yml # - /Maps/_NF/Shuttles/Scrap/canister.yml # Too small