Skip to content

Commit 4eb5782

Browse files
committed
Fix to choice right after condition
1 parent 4b349a0 commit 4eb5782

4 files changed

Lines changed: 7 additions & 5 deletions

File tree

addons/dialogic/Core/DialogicGameHandler.gd

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -210,6 +210,8 @@ func start_timeline(timeline:Variant, label_or_idx:Variant = "") -> void:
210210

211211
current_timeline = timeline
212212
current_timeline_events = current_timeline.events
213+
for event in current_timeline_events:
214+
event.dialogic = self
213215
current_event_idx = -1
214216

215217
if typeof(label_or_idx) == TYPE_STRING:

addons/dialogic/Modules/Choice/subsystem_choices.gd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@ func is_question(index:int) -> bool:
258258

259259
if dialogic.current_timeline_events[index] is DialogicChoiceEvent:
260260
if index != 0 and dialogic.current_timeline_events[index-1] is DialogicEndBranchEvent:
261-
if dialogic.current_timeline_events[dialogic.current_timeline_events[index-1].find_opening_index()] is DialogicChoiceEvent:
261+
if dialogic.current_timeline_events[dialogic.current_timeline_events[index-1].find_opening_index(index-1)] is DialogicChoiceEvent:
262262
return false
263263
else:
264264
return true

addons/dialogic/Modules/Condition/event_condition.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,9 +24,9 @@ func _execute() -> void:
2424

2525
if condition.is_empty(): condition = "true"
2626

27-
var result :bool= dialogic.Expressions.execute_condition(condition)
27+
var result: bool = dialogic.Expressions.execute_condition(condition)
2828
if not result:
29-
var idx :int = dialogic.current_event_idx
29+
var idx: int = dialogic.current_event_idx
3030
var ignore := 1
3131
while true:
3232
idx += 1

addons/dialogic/Modules/Core/event_end_branch.gd

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,8 @@ func find_next_index() -> int:
3434
return idx
3535

3636

37-
func find_opening_index() -> int:
38-
var idx: int = dialogic.current_event_idx
37+
func find_opening_index(at_index:int) -> int:
38+
var idx: int = at_index
3939

4040
var ignore: int = 1
4141
while true:

0 commit comments

Comments
 (0)