[Klonan] [1.1.59] Ungraceful error associated with jump_to_cutscene_waypoint out-of-bounds

Post Reply
Filter Inserter
Filter Inserter
Posts: 983
Joined: Thu Oct 03, 2019 7:10 am

[Klonan] [1.1.59] Ungraceful error associated with jump_to_cutscene_waypoint out-of-bounds

Post by Honktown »

I wanted to pcall(player.jump_to_cutscene_waypoint, event.waypoint_index + 1) during on_cutscene_waypoint_reached, to test if the waypoint just reached was the final (within reason). Was in the middle of testing what was true (are we still in cutscene controller, what gets raised, etc) and ran into a side-effect.

Logically speaking, either the waypoint is set to it's current value (doing nothing, maybe raising reached event which would be avoided the second time) or an error is raised: index out of bounds, meaning the last waypoint just ended the cutscene.

Expectation: Error is raised without side-effects.
Reality: Error with side effect of raising on_cutscene_waypoint_reached only when omitting a final_transition_time

0) listen to reached event and set an incremented index

1) Create a set_controller argument table with some waypoints.
2) omit a final_transition_time
3) set_controller(cutscene)

Game repeatedly raises waypoint reached with higher indices, never leaving the cutscene.
If final_transition_time is present* [edit], there is no side-effect.

Code is provided:
(1.56 KiB) Downloaded 44 times
I understand the nature of this is "there's a side effect from *an error*, could you fix the side effect?", but it is a strange incident that I thought someone might want to know about.
waypoint_spam.jpg (505.28 KiB) Viewed 661 times
I have mods! I guess!

User avatar
Factorio Staff
Factorio Staff
Posts: 5101
Joined: Sun Jan 11, 2015 2:09 pm

Re: [Klonan] [1.1.59] Ungraceful error associated with jump_to_cutscene_waypoint out-of-bounds

Post by Klonan »

Its not really a side effect of an error, just a bug, that if you set the index to the last index when you have no final transtion time, it would fail its 'Am I finished check' and loop forever.

I fixed it for 1.2

Post Reply

Return to “Fixed for 1.2”