fix(client): resolve GDScript autoload parse-order errors
Autoload scripts are parsed before regular scripts, so class_name types (CharacterVisualDescriptor, TestHarness, YamlParser) are not available at parse time. Replace type annotations with untyped vars and use load() for in-body class references. Fixes all 14 headless parse errors (9 pre-existing + 5 from Sprint 30 changes). Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -100,7 +100,8 @@ var character_archetype: String = "detective"
|
||||
# #705: Character visual descriptor — set by character_creation.gd on confirmation.
|
||||
# Passed to EntityRenderer for the player entity's CharacterVisual on game start.
|
||||
# Null when no custom appearance has been selected (fallback: default descriptor).
|
||||
var character_visual_descriptor: CharacterVisualDescriptor = null
|
||||
# Type is CharacterVisualDescriptor — untyped to avoid autoload parse-order issue.
|
||||
var character_visual_descriptor = null
|
||||
|
||||
# #646: AI-Enhanced Dialogue enabled state (D-138).
|
||||
# Runtime toggle — true means the LLM re-voicing pipeline should run (server-side).
|
||||
@@ -366,7 +367,8 @@ func apply_snapshot(snapshot: Dictionary) -> void:
|
||||
# Server persists the descriptor and includes it in ObserverSnapshot after load.
|
||||
# Only update when field is present (null means no change).
|
||||
if snapshot.has("character_visual_descriptor") and snapshot.character_visual_descriptor is Dictionary:
|
||||
var restored := CharacterVisualDescriptor.from_dict(snapshot.character_visual_descriptor)
|
||||
var CVD := load("res://scripts/rendering/character_visual_descriptor.gd")
|
||||
var restored = CVD.from_dict(snapshot.character_visual_descriptor)
|
||||
if restored != null:
|
||||
character_visual_descriptor = restored
|
||||
|
||||
|
||||
Reference in New Issue
Block a user