Skip to content

Commit e5d0ba8

Browse files
authored
Fix: Cache defaults for unique scenes which use the same script (#2676)
Dialogic stores the default values of scene exports for custom layers and portraits (so they can be reset correctly). However it would cache them per-script, even though different scenes can have the same script AND different exports. They are now stored by scene path instead.
1 parent b8ce9b5 commit e5d0ba8

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

addons/dialogic/Core/DialogicUtil.gd

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -323,8 +323,8 @@ static func get_scene_export_defaults(node:Node) -> Dictionary:
323323
return {}
324324

325325
if Engine.get_main_loop().has_meta('dialogic_scene_export_defaults') and \
326-
node.script.resource_path in Engine.get_main_loop().get_meta('dialogic_scene_export_defaults'):
327-
return Engine.get_main_loop().get_meta('dialogic_scene_export_defaults')[node.script.resource_path]
326+
node.scene_file_path in Engine.get_main_loop().get_meta('dialogic_scene_export_defaults'):
327+
return Engine.get_main_loop().get_meta('dialogic_scene_export_defaults')[node.scene_file_path]
328328

329329
if !Engine.get_main_loop().has_meta('dialogic_scene_export_defaults'):
330330
Engine.get_main_loop().set_meta('dialogic_scene_export_defaults', {})
@@ -333,7 +333,7 @@ static func get_scene_export_defaults(node:Node) -> Dictionary:
333333
for i in property_info:
334334
if i['usage'] & PROPERTY_USAGE_EDITOR == PROPERTY_USAGE_EDITOR:
335335
defaults[i['name']] = node.get(i['name'])
336-
Engine.get_main_loop().get_meta('dialogic_scene_export_defaults')[node.script.resource_path] = defaults
336+
Engine.get_main_loop().get_meta('dialogic_scene_export_defaults')[node.scene_file_path] = defaults
337337
return defaults
338338

339339
#endregion

0 commit comments

Comments
 (0)