Skip to content

fix(trash-cleanup): never clean grids hosting worldloaders#1661

Draft
Kronyxxx wants to merge 3 commits intoHardLightSector:masterfrom
Kronyxxx:fix/colcomm-grid-cleanup-protection
Draft

fix(trash-cleanup): never clean grids hosting worldloaders#1661
Kronyxxx wants to merge 3 commits intoHardLightSector:masterfrom
Kronyxxx:fix/colcomm-grid-cleanup-protection

Conversation

@Kronyxxx
Copy link
Copy Markdown
Collaborator

@Kronyxxx Kronyxxx commented May 6, 2026

Summary

Adds a safety guard to trash cleanup so infrastructure grids that host world loaders are never deleted by distance-based cleanup.

Problem

Trash cleanup currently protects loader-adjacent grids indirectly via protection zones calculated from world loader positions. If those assumptions drift or a loader edge case occurs, a critical loader-hosting grid can still become cleanup-eligible.

Solution

Add a direct guard in ShouldProtectGrid():

  • If a grid has WorldLoaderComponent, treat it as protected and skip cleanup.

Files Changed

  • Content.Server/Trash/TrashCleanupSystem.cs

Behavior Impact

  • Loader-hosting grids are now always excluded from trash cleanup.
  • No gameplay/system behavior changes outside cleanup eligibility.

Risk

Low.

  • Change is narrowly scoped to one protection predicate.
  • Only affects grids explicitly carrying WorldLoaderComponent.

Validation

  • Verified diagnostics: no errors in modified file.
  • Confirmed change is limited to cleanup protection logic.

Related

Copy link
Copy Markdown
Contributor

@ShadesMars ShadesMars left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If doing this way, delete CleanupProtectedGridComponent as its not usefull.

Worldloader can also be disabled in a variable, so lets not have two comp that does the same.

@Kronyxxx
Copy link
Copy Markdown
Collaborator Author

Kronyxxx commented May 6, 2026

still a draft lol yeah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants