Skip to content

Commit c3549e6

Browse files
committed
core: Enqueue current frame on registration
1 parent 7891831 commit c3549e6

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/src/display_object/movie_clip.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2193,7 +2193,10 @@ impl<'gc> MovieClip<'gc> {
21932193
frame_scripts[index] = None;
21942194
}
21952195
if frame_id == current_frame {
2196+
// Ensure newly registered frame scripts are executed,
2197+
// even if the frame is repeated due to goto.
21962198
write.last_queued_script_frame = None;
2199+
write.queued_script_frame = Some(current_frame);
21972200
}
21982201
}
21992202

@@ -2647,6 +2650,7 @@ impl<'gc> TDisplayObject<'gc> for MovieClip<'gc> {
26472650
write.frame_scripts.get(frame_id as usize).cloned()
26482651
{
26492652
write.last_queued_script_frame = Some(frame_id);
2653+
write.queued_script_frame = None;
26502654
write.set_flag(MovieClipFlags::EXECUTING_AVM2_FRAME_SCRIPT, true);
26512655

26522656
drop(write);

0 commit comments

Comments
 (0)