Skip to content

Commit

Permalink
Fix "timeline info could reset after new timeline was loaded"
Browse files Browse the repository at this point in the history
Also removes the bool return value from clear() because it had no use.
  • Loading branch information
Jowan-Spooner committed Apr 15, 2024
1 parent a7374a6 commit b2b9802
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions addons/dialogic/Core/DialogicGameHandler.gd
Original file line number Diff line number Diff line change
Expand Up @@ -287,22 +287,22 @@ func handle_event(event_index:int) -> void:
## By using the clear flags from the [member ClearFlags] enum you can specify
## what info should be kept.
## For example, at timeline end usually it doesn't clear node or subsystem info.
func clear(clear_flags := ClearFlags.FULL_CLEAR) -> bool:

func clear(clear_flags := ClearFlags.FULL_CLEAR) -> void:
if !clear_flags & ClearFlags.TIMELINE_INFO_ONLY:
for subsystem in get_children():
if subsystem is DialogicSubsystem:
(subsystem as DialogicSubsystem).clear_game_state(clear_flags)

# Resetting variables
if current_timeline:
await current_timeline.clean()
var timeline := current_timeline

current_timeline = null
current_event_idx = -1
current_timeline_events = []
current_state = States.IDLE
return true

# Resetting variables
if timeline:
await timeline.clean()

#endregion

Expand Down

0 comments on commit b2b9802

Please sign in to comment.