Summary
Eight .gd files use the legacy Godot 3.x pattern JSON.new().parse(text) instead of the Godot 4.x idiomatic JSON.parse_string(text). This is inconsistent with scripts/autoload/config_loader.gd:139 which already uses the modern pattern.
Files Affected
| File |
Lines |
scripts/combat/room_loader.gd |
29-30 |
scripts/core/encounter_system.gd |
55-56 |
scripts/core/loot_table.gd |
29-30 |
scripts/core/room_generator.gd |
86-87 |
scripts/autoload/settings_manager.gd |
75-76 |
scripts/autoload/grid_system.gd |
166-167 |
scripts/autoload/save_manager.gd |
131-132 |
scripts/entities/apparition_renderer.gd |
124-125 |
Suggested Fix
Replace:
var json := JSON.new()
var err := json.parse(text)
if err != OK:
push_error("...")
return {}
return json.data
With:
var data: Variant = JSON.parse_string(text)
if data == null or not data is Dictionary:
push_error("...")
return {}
return data
Priority: P1 · Size: S (was XS — expanded from 1 file to 8) · Status: Ready
Summary
Eight
.gdfiles use the legacy Godot 3.x patternJSON.new().parse(text)instead of the Godot 4.x idiomaticJSON.parse_string(text). This is inconsistent withscripts/autoload/config_loader.gd:139which already uses the modern pattern.Files Affected
scripts/combat/room_loader.gdscripts/core/encounter_system.gdscripts/core/loot_table.gdscripts/core/room_generator.gdscripts/autoload/settings_manager.gdscripts/autoload/grid_system.gdscripts/autoload/save_manager.gdscripts/entities/apparition_renderer.gdSuggested Fix
Replace:
With:
Priority: P1 · Size: S (was XS — expanded from 1 file to 8) · Status: Ready