Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix/background holder dangling reference #1958

Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion addons/dialogic/Modules/Background/subsystem_backgrounds.gd
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,8 @@ func update_background(scene:String = '', argument:String = '', fade_time:float
trans_node.next_texture = new_viewport.get_child(0).get_texture()
new_viewport.get_meta('node')._update_background(argument, fade_time)
new_viewport.get_meta('node')._custom_fade_in(fade_time)
else:
background_holder.remove_meta('current_viewport')

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