diff --git a/lost-sector/src/main/java/com/ezardlabs/lostsector/map/procedural/MapConfig.java b/lost-sector/src/main/java/com/ezardlabs/lostsector/map/procedural/MapConfig.java index 60af9ad..bb6718a 100644 --- a/lost-sector/src/main/java/com/ezardlabs/lostsector/map/procedural/MapConfig.java +++ b/lost-sector/src/main/java/com/ezardlabs/lostsector/map/procedural/MapConfig.java @@ -47,7 +47,26 @@ public class MapConfig { this.minMapHeight = (int)((-3 * MapManager.TILE_SIZE) + MapManager.PROC_START_POS.y); this.maxMapHeight = (int)((3 * MapManager.TILE_SIZE) + MapManager.PROC_START_POS.y); - this.proceduralSeed = System.currentTimeMillis(); + /* + * LS_SEED (env) : reproduire une map procédurale PRÉCISE — le seed + * est loggué à chaque génération (MapManager.loadProceduralMap) + * précisément POUR reproduire les maps fautives des gamelogs + * utilisateur, mais aucun injecteur n'existait : la reproduction + * exigeait un patch à la main. Outil de test/dev, même pattern que + * LS_LEVEL (Game.java). Absent/invalide = seed temps réel + * (comportement normal). + */ + String seedEnv = System.getenv("LS_SEED"); + if (seedEnv != null && !seedEnv.isEmpty()) { + try { + this.proceduralSeed = Long.parseLong(seedEnv.trim()); + } catch (NumberFormatException e) { + GameLog.w("LS-MAP", "LS_SEED invalide ('" + seedEnv + "'), seed temps réel utilisé"); + this.proceduralSeed = System.currentTimeMillis(); + } + } else { + this.proceduralSeed = System.currentTimeMillis(); + } spawnSegments = new HashMap<>(); mainSegments = new HashMap<>();