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:
@@ -67,6 +67,7 @@ class DB extends RefCounted:
|
||||
func _load_levels(data: Array) -> Array[LevelEntry]:
|
||||
var result: Array[LevelEntry] = []
|
||||
const W := 2
|
||||
@warning_ignore("integer_division")
|
||||
for i in range(data.size() / W):
|
||||
var l := LevelEntry.new()
|
||||
l.index = i
|
||||
@@ -78,6 +79,7 @@ class DB extends RefCounted:
|
||||
func _load_scenes(data: Array) -> Array[SceneEntry]:
|
||||
var result: Array[SceneEntry] = []
|
||||
const W := 7
|
||||
@warning_ignore("integer_division")
|
||||
for i in range(data.size() / W):
|
||||
var s := SceneEntry.new()
|
||||
s.lock = bool(int(data[i * W + 0]))
|
||||
|
||||
Reference in New Issue
Block a user