From 219d3af284362a35896826add442256b0bc699c7 Mon Sep 17 00:00:00 2001 From: Mike Welsh Date: Mon, 11 Oct 2021 14:53:24 -0700 Subject: [PATCH] avm1: Function base clip defaults to `this` if clip no longer exists When a function is defined, the base clip is stored in the function object, and used when the function is called in SWFv6+. This affects the target clip for GotoFrame and other actions. However, if that base clip no longer exists when the function is called, the base clip should default to the `this` display object. Previously Ruffle would still use the previously unloaded base clip. --- core/src/avm1/function.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/core/src/avm1/function.rs b/core/src/avm1/function.rs index 91a31f080..0f7755770 100644 --- a/core/src/avm1/function.rs +++ b/core/src/avm1/function.rs @@ -305,7 +305,7 @@ impl<'gc> Executable<'gc> { }; let max_recursion_depth = activation.context.avm1.max_recursion_depth(); - let base_clip = if effective_ver > 5 { + let base_clip = if effective_ver > 5 && !af.base_clip.removed() { af.base_clip } else { this.as_display_object()