Corpse Cleaner

by ea1a87

Removes character corpses older than configurable time. Skips surfaces without players.

Utilities
8 days ago
2.0
8
Combat Character

Changelog

Version: 0.0.5
Date: 02.07.2026
  Bugfixes:
    - Fixed crash when global.last_cleanup_tick was nil during on_player_changed_surface event.
    - Added defensive ensure_last_cleanup_tick() function to all relevant handlers.
    - Replaced surface.players with game.connected_players for compatibility with Factorio 2.0.77.
  Changes:
    - Renamed TICKS_PER_MINUTE constant to TPM for readability.
    - Removed all comments from control.lua.
Version: 0.0.4
Date: 02.07.2026
  Bugfixes:
    - Fixed attempt to index global 'global' (a nil value) during on_init by adding guard clause.
    - Added global existence check at script load time for migration scenarios.
  Changes:
    - Extracted TICKS_PER_MINUTE constant for maintainability.
Version: 0.0.3
Date: 28.06.2026
  Features:
    - Scan interval is now configurable via mod settings (default 10 minutes).
    - Surfaces without players are skipped to improve performance.
    - Tracks last cleanup time per surface; cleans when player returns after interval elapsed.
    - Dynamic re-registration of on_nth_tick handler when interval setting changes.
  Changes:
    - Max corpse age moved to mod settings with configurable range 1–1440 minutes.
    - Added English localization for setting names and descriptions.
  Bugfixes:
    - Fixed surface.players compatibility issue with older Factorio 2.0 versions.
Version: 0.0.2
Date: 28.06.2026
  Features:
    - Made scan interval and max corpse age configurable via mod settings.
    - Optimized for UPS by reducing scan frequency and skipping inactive surfaces.
  Changes:
    - Default scan interval changed from 1 minute to 10 minutes.
    - Added locale support for English.
Version: 0.0.1
Date: 28.06.2026
  Features:
    - Initial release.
    - Removes character corpses older than 1 hour.
    - Scans all surfaces every 1 minute by default.