Fix Levels.gd type inference + Database integer-division warning + brighten scenes

- scenes/levels/Levels.gd: replace 'var level := Global.database
  .level_by_index(...)' with explicit 'var level: LevelEntry = ...'.
  Global.database is typed RefCounted so the parser can't see DB's
  return types through the walrus operator. Two callsites.
- scripts/Database.gd: annotate the two 'range(data.size() / W)'
  loops with @warning_ignore('integer_division'). The division is
  intentional (row count = bytes / row width); Godot 4 warns by
  default in case the slash was a typo.
- env: ambient_light_energy 0.4 -> 1.0 in WarCraft.tscn, Home.tscn
  and env_warcraft.tres. 0.4 left the floor pitch-black; 1.0 is a
  compromise between the original 1.55 (oversaturated) and this.
  Re-baking the lightmap in the editor is still the right fix —
  this commit just keeps the scene playable in the meantime.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
Vaillant Jeremy
2026-05-16 22:02:59 +02:00
parent c17769246f
commit 6146d84b87
5 changed files with 7 additions and 5 deletions
+2 -2
View File
@@ -34,7 +34,7 @@ func _load_back_button() -> void:
$Quit/TextureButton.pressed.connect(Event._on_main_scene_pressed)
func _load_prepare_victory_condition() -> void:
var level := Global.database.level_by_index(Global.current_scene_int)
var level: LevelEntry = Global.database.level_by_index(Global.current_scene_int)
if level == null:
return
victory_condition = level.object_to_find()
@@ -133,7 +133,7 @@ func _check_dissolve_mesh() -> void:
_clean_mesh(key)
func _clean_mesh(key: String) -> void:
var level := Global.database.level_by_index(Global.current_scene_int)
var level: LevelEntry = Global.database.level_by_index(Global.current_scene_int)
if level != null:
victory_progress = level.object_finding()
var mesh := _node_to_mesh(key)