Skip to content

Commit 8f21e25

Browse files
authored
Fix/background holder dangling reference (#1958)
* remove current viewport meta when no new instance is available * made error a bit more verbose.
1 parent b96d4aa commit 8f21e25

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

addons/dialogic/Modules/Background/subsystem_backgrounds.gd

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,8 @@ func update_background(scene:String = '', argument:String = '', fade_time:float
9696
trans_node.next_texture = new_viewport.get_child(0).get_texture()
9797
new_viewport.get_meta('node')._update_background(argument, fade_time)
9898
new_viewport.get_meta('node')._custom_fade_in(fade_time)
99+
else:
100+
background_holder.remove_meta('current_viewport')
99101

100102
add_child(trans_node)
101103
trans_node._fade()
@@ -109,7 +111,7 @@ func add_background_node(scene:PackedScene, parent:DialogicNode_BackgroundHolder
109111
var viewport := SubViewport.new()
110112
var b_scene := scene.instantiate()
111113
if not b_scene is DialogicBackground:
112-
printerr("[Dialogic] Given background scene was not of type DialogicBackground!")
114+
printerr("[Dialogic] Given background scene was not of type DialogicBackground! Make sure the scene has a script that extends DialogicBackground.")
113115
v_con.queue_free()
114116
viewport.queue_free()
115117
b_scene.queue_free()

0 commit comments

Comments
 (0)