Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prevent player despawning on salvage and other debris #2661

Merged
merged 7 commits into from
Jan 7, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading