Skip to content

Commit de31aa6

Browse files
authored
Fix script loading on Godot 4.3 (#197)
1 parent 5dba6d4 commit de31aa6

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

addons/pandora/model/type.gd

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,8 +73,9 @@ static func lookup(name: String) -> PandoraPropertyType:
7373

7474
if ResourceLoader.exists(type_path):
7575
var ScriptType = load(type_path)
76-
if ScriptType != null and ScriptType.has_source_code():
77-
return ScriptType.new()
76+
if ScriptType != null:
77+
if ScriptType.has_source_code() or ScriptType.can_instantiate():
78+
return ScriptType.new()
7879

7980
return UndefinedType.new()
8081

addons/pandora/util/script_util.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ static func create_entity_from_script(
3939

4040
static func _get_entity_class(path: String) -> GDScript:
4141
var EntityClass = load(path)
42-
if EntityClass == null:
42+
if EntityClass == null or not EntityClass.can_instantiate():
4343
push_warning("Unable to find " + path + " - defaulting to PandoraEntity instead.")
4444
EntityClass = PandoraEntityScript
4545
return EntityClass

0 commit comments

Comments
 (0)