diff --git a/src/game/engine/src/modules/climate/ecological_event_utils.gd b/src/game/engine/src/modules/climate/ecological_event_utils.gd index 98625dfc..c0333f4d 100644 --- a/src/game/engine/src/modules/climate/ecological_event_utils.gd +++ b/src/game/engine/src/modules/climate/ecological_event_utils.gd @@ -91,7 +91,13 @@ static func spawn_resource(tile: Variant, cfg: Dictionary) -> void: spawn_resource_weighted(tile, table) return - var resource_id: String = cfg.get("spawns_resource", "") + # `Dictionary.get(key, default)` only returns `default` when the key is + # ABSENT — a config with an explicit `"spawns_resource": null` returns + # `null` (Nil), which crashes a direct assignment to a typed `String`. + # Guard the null/absent case → no-spawn, matching `resource_terrain` below. + var resource_id: String = "" + if cfg.get("spawns_resource") != null: + resource_id = str(cfg["spawns_resource"]) if resource_id == "" or resource_id == "null": return var resource_terrain: Variant = cfg.get("resource_terrain", null)