mirror of
https://github.com/bryanthaboi/gen1recomp.git
synced 2026-08-16 16:21:30 +02:00
The shrink timeline called finish() every frame once past its end. finish() emits finished and then pops the stack, so a listener that pushes a screen (a warp, a menu) had that screen popped in the speech's place: the speech stayed alive and re-fired the event every frame, repeating the listener's side effects each time. Clear the shrink state before finishing so the timeline cannot run finish() twice. Co-authored-by: johnjohto <johnjohto@users.noreply.github.com>
This commit is contained in:
@@ -549,6 +549,10 @@ function OakSpeech:update(dt)
|
||||
elseif s.frame >= 79 and s.frame <= 102 then
|
||||
self.fadeLevel = math.floor((s.frame - 79) / 8) + 1
|
||||
elseif s.frame > 102 then
|
||||
-- clear before finish(): a finished-listener that pushes a state gets
|
||||
-- ITS state popped in the speech's place, and a live shrink would call
|
||||
-- finish() again next frame, re-firing the event every frame (#308)
|
||||
self.shrink = nil
|
||||
self:finish()
|
||||
end
|
||||
end
|
||||
|
||||
Reference in New Issue
Block a user