ruffle-rs / ruffle

A Flash Player emulator written in Rust
https://ruffle.rs
Other
15.44k stars 799 forks source link

`Avm1Function`'s `base_clip` field should be a string path, not a display object #14562

Open Lord-McSweeney opened 8 months ago

Lord-McSweeney commented 8 months ago

Describe the bug

In core/src/avm1/function.rs

pub struct Avm1Function<'gc> {
    ...
    base_clip: DisplayObject<'gc>, // <-- This should be a string path to the base clip
    ...
}

I haven't tested whether this is version-gated or not.

Expected behavior

The function references whatever DO is at the path instead of keeping a reference to a specific DO.

Content Location

Champion Archer (#6124) is broken due to this.

Affected platform

Desktop app

Operating system

Irrelevant

Browser

Irrelevant

Additional information

This is the root cause of #6124.

Dinnerbone commented 3 months ago

Test for this: function_base_clip_readded.zip