core: Same-frame gotos should only proceed on AVM2.

This commit is contained in:
David Wendt 2022-01-22 18:22:47 -05:00 committed by kmeisthax
parent cdfc6f5eae
commit 99003643ac
1 changed files with 13 additions and 11 deletions

View File

@ -788,17 +788,19 @@ impl<'gc> MovieClip<'gc> {
// Clamp frame number in bounds.
let frame = frame.max(1);
if self
.0
.read()
.flags
.contains(MovieClipFlags::EXECUTING_AVM2_FRAME_SCRIPT)
{
// AVM2 does not allow a clip to see while it is executing a frame script.
// The goto is instead queued and run once the frame script is completed.
self.0.write(context.gc_context).queued_goto_frame = Some(frame);
} else {
self.run_goto(context, frame, false);
if frame != self.current_frame() || context.is_action_script_3() {
if self
.0
.read()
.flags
.contains(MovieClipFlags::EXECUTING_AVM2_FRAME_SCRIPT)
{
// AVM2 does not allow a clip to see while it is executing a frame script.
// The goto is instead queued and run once the frame script is completed.
self.0.write(context.gc_context).queued_goto_frame = Some(frame);
} else {
self.run_goto(context, frame, false);
}
}
}