avm1: SetTarget of a removed clip is invalid
A `SetTarget` call should ignore any clip that has been removed. This can happen in cases such as `tellTarget("_root")` seeking to a frame where the clip no longer exists. Fixes this issue: https://github.com/ruffle-rs/ruffle/pull/4452#issuecomment-860747028
This commit is contained in:
parent
ed1bfd74fe
commit
2f25887080
|
@ -2959,7 +2959,9 @@ impl<'a, 'gc, 'gc_context> Activation<'a, 'gc, 'gc_context> {
|
|||
|
||||
/// Changes the target clip.
|
||||
pub fn set_target_clip(&mut self, value: Option<DisplayObject<'gc>>) {
|
||||
self.target_clip = value;
|
||||
// The target should revert to `None` if the clip is removed.
|
||||
let is_clip_removed = value.map(|clip| clip.removed()).unwrap_or_default();
|
||||
self.target_clip = if !is_clip_removed { value } else { None }
|
||||
}
|
||||
|
||||
/// Define a local property on the activation.
|
||||
|
|
Loading…
Reference in New Issue