From a67976f601096601a7e3b80f2228a0f68a22fd7b Mon Sep 17 00:00:00 2001 From: CUB3D Date: Fri, 10 Feb 2023 00:56:54 +0000 Subject: [PATCH] avm1: Fix add2 coerce --- core/src/avm1/activation.rs | 2 +- core/src/avm1/value.rs | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/core/src/avm1/activation.rs b/core/src/avm1/activation.rs index 8dc1ec3b0..9311664ee 100644 --- a/core/src/avm1/activation.rs +++ b/core/src/avm1/activation.rs @@ -576,7 +576,7 @@ impl<'a, 'gc> Activation<'a, 'gc> { }; let b = if let Value::MovieClip(_, _) = b { - a.coerce_to_string(self)?.into() + b.coerce_to_string(self)?.into() } else { b }; diff --git a/core/src/avm1/value.rs b/core/src/avm1/value.rs index e52f748c2..55699b55a 100644 --- a/core/src/avm1/value.rs +++ b/core/src/avm1/value.rs @@ -417,7 +417,7 @@ impl<'gc> Value<'gc> { Value::MovieClip(path, mc) => { if let Some(mc) = mc.upgrade(activation.context.gc_context) { if !mc.read().display_object.removed() - | mc.read().display_object.pending_removal() + || mc.read().display_object.pending_removal() { // Note that we can't re-use the `path` from the value above sadly, it would be quicker if we could // But if the clip has been re-named, since being created then `mc.path() != path` @@ -509,7 +509,7 @@ impl<'gc> Value<'gc> { if let Value::MovieClip(path, mc) = self { // Check if we can re-use the cached `DisplayObject`, if we can then take this fast path if let Some(mc) = mc.upgrade(activation.context.gc_context) { - if !mc.read().display_object.removed() || mc.read().display_object.pending_removal() + if !mc.read().display_object.removed() || mc.read().display_object.pending_removal() { return mc .read()