Skip to content

Commit

Permalink
Prevent player despawning on salvage and other debris (#2661)
Browse files Browse the repository at this point in the history
* 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 <[email protected]>
  • Loading branch information
GreaseMonk and dvir001 authored Jan 7, 2025
1 parent eab733a commit e5a6625
Show file tree
Hide file tree
Showing 6 changed files with 34 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Content.Server/Worldgen/Systems/LocalityLoaderSystem.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,5 +6,7 @@
- type: LocalityLoader
- type: GCAbleObject
queue: SpaceDebris
- type: LinkedLifecycleGridParent
- type: ProtectedGrid
preventArtifactTriggers: true
preventArtifactTriggers: true
- type: PreventPilot
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
- type: LinkedLifecycleGridParent
- type: ProtectedGrid
preventArtifactTriggers: true
- type: PreventPilot
protos:
- NFVGRoidBasalt

Expand Down
24 changes: 24 additions & 0 deletions Resources/Prototypes/_NF/Events/nf_bluespace_grids_events.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,9 @@
angularDamping: 999999
linearDamping: 999999
- type: LinkedLifecycleGridParent
- type: ProtectedGrid
preventArtifactTriggers: true
- type: PreventPilot
paths:
- /Maps/_NF/Bluespace/cache.yml
rewardAccounts:
Expand Down Expand Up @@ -71,6 +74,9 @@
angularDamping: 999999
linearDamping: 999999
- type: LinkedLifecycleGridParent
- type: ProtectedGrid
preventArtifactTriggers: true
- type: PreventPilot
paths:
- /Maps/_NF/Bluespace/vault.yml
rewardAccounts:
Expand Down Expand Up @@ -111,6 +117,9 @@
angularDamping: 999999
linearDamping: 999999
- type: LinkedLifecycleGridParent
- type: ProtectedGrid
preventArtifactTriggers: true
- type: PreventPilot
paths:
- /Maps/_NF/Bluespace/vaultsmall.yml
rewardAccounts:
Expand Down Expand Up @@ -149,6 +158,9 @@
angularDamping: 999999
linearDamping: 999999
- type: LinkedLifecycleGridParent
- type: ProtectedGrid
preventArtifactTriggers: true
- type: PreventPilot
paths:
- /Maps/_NF/Bluespace/syndieftlintercept.yml

Expand Down Expand Up @@ -185,6 +197,9 @@
angularDamping: 999999
linearDamping: 999999
- type: LinkedLifecycleGridParent
- type: ProtectedGrid
preventArtifactTriggers: true
- type: PreventPilot
paths:
- /Maps/_NF/Bluespace/wizardprobealt.yml

Expand Down Expand Up @@ -221,6 +236,9 @@
angularDamping: 999999
linearDamping: 999999
- type: LinkedLifecycleGridParent
- type: ProtectedGrid
preventArtifactTriggers: true
- type: PreventPilot
paths:
- /Maps/_NF/Bluespace/bloodmoon.yml

Expand Down Expand Up @@ -255,6 +273,9 @@
angularDamping: 999999
linearDamping: 999999
- type: LinkedLifecycleGridParent
- type: ProtectedGrid
preventArtifactTriggers: true
- type: PreventPilot
paths:
- /Maps/_NF/Bluespace/cave.yml

Expand Down Expand Up @@ -286,5 +307,8 @@
addComponents:
- type: IFF
- type: LinkedLifecycleGridParent
- type: ProtectedGrid
preventArtifactTriggers: true
- type: PreventPilot
paths:
- /Maps/_NF/Bluespace/mcevent.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit e5a6625

Please sign in to comment.