fix(core): enforce CharacterData compile order and remove ClassDB type lookup on export

character.gd referenced CharacterData.State as a compile-time constant dict,
causing export to fail when character.gd was compiled before character_data.gd
(alphabetical order). The preload forces character_data.gd to be compiled first.
Changing SubResource type to "Resource" removes the ClassDB lookup for the
custom class name during scene export, relying on the explicit script reference
instead.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
This commit is contained in:
Steven Wroblewski
2026-04-17 13:11:30 +02:00
parent 8f416b8999
commit 51bfd1718b
2 changed files with 3 additions and 1 deletions

View File

@@ -8,7 +8,7 @@
[ext_resource type="PackedScene" path="res://scenes/objects/ElevatorButton.tscn" id="6_elevbtn"]
[ext_resource type="Script" path="res://scripts/characters/character_data.gd" id="7_chardata"]
[sub_resource type="CharacterData" id="CharacterData_bunny1"]
[sub_resource type="Resource" id="CharacterData_bunny1"]
script = ExtResource("7_chardata")
id = "bunny_01"
display_name = "Bunny"