avm1: Fix add2 coerce

This commit is contained in:
CUB3D 2023-02-10 00:56:54 +00:00 committed by Nathan Adams
parent 1fdd8f1a82
commit a67976f601
2 changed files with 3 additions and 3 deletions

View File

@ -576,7 +576,7 @@ impl<'a, 'gc> Activation<'a, 'gc> {
}; };
let b = if let Value::MovieClip(_, _) = b { let b = if let Value::MovieClip(_, _) = b {
a.coerce_to_string(self)?.into() b.coerce_to_string(self)?.into()
} else { } else {
b b
}; };

View File

@ -417,7 +417,7 @@ impl<'gc> Value<'gc> {
Value::MovieClip(path, mc) => { Value::MovieClip(path, mc) => {
if let Some(mc) = mc.upgrade(activation.context.gc_context) { if let Some(mc) = mc.upgrade(activation.context.gc_context) {
if !mc.read().display_object.removed() 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 // 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` // 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 { if let Value::MovieClip(path, mc) = self {
// Check if we can re-use the cached `DisplayObject`, if we can then take this fast path // 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 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 return mc
.read() .read()