Skip to content

Commit 6e798a1

Browse files
Fix "timeline info could reset after new timeline was loaded" (#2184)
Also removes the bool return value from clear() because it had no use.
1 parent a7374a6 commit 6e798a1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

addons/dialogic/Core/DialogicGameHandler.gd

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -287,22 +287,22 @@ func handle_event(event_index:int) -> void:
287287
## By using the clear flags from the [member ClearFlags] enum you can specify
288288
## what info should be kept.
289289
## For example, at timeline end usually it doesn't clear node or subsystem info.
290-
func clear(clear_flags := ClearFlags.FULL_CLEAR) -> bool:
291-
290+
func clear(clear_flags := ClearFlags.FULL_CLEAR) -> void:
292291
if !clear_flags & ClearFlags.TIMELINE_INFO_ONLY:
293292
for subsystem in get_children():
294293
if subsystem is DialogicSubsystem:
295294
(subsystem as DialogicSubsystem).clear_game_state(clear_flags)
296295

297-
# Resetting variables
298-
if current_timeline:
299-
await current_timeline.clean()
296+
var timeline := current_timeline
300297

301298
current_timeline = null
302299
current_event_idx = -1
303300
current_timeline_events = []
304301
current_state = States.IDLE
305-
return true
302+
303+
# Resetting variables
304+
if timeline:
305+
await timeline.clean()
306306

307307
#endregion
308308

0 commit comments

Comments
 (0)