From 34f864f27c66dbee935cf8a4166ad2be688c40f6 Mon Sep 17 00:00:00 2001 From: Lord-McSweeney Date: Sun, 30 Jun 2024 18:04:49 +0300 Subject: [PATCH] avm2: Add stub notices for reusing Loader --- core/src/avm2/globals/flash/display/loader.rs | 22 +++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/core/src/avm2/globals/flash/display/loader.rs b/core/src/avm2/globals/flash/display/loader.rs index 5d741e5277d5a..62843f008173a 100644 --- a/core/src/avm2/globals/flash/display/loader.rs +++ b/core/src/avm2/globals/flash/display/loader.rs @@ -77,6 +77,17 @@ pub fn load<'gc>( let loader_info_object = loader_info.as_loader_info_object().unwrap(); + if loader_info_object.init_event_fired() { + // FIXME: When calling load/loadBytes, then calling load/loadBytes again + // before the `init` event is fired, the first load is cancelled. + avm2_stub_method!( + activation, + "flash.display.Loader", + "load", + "reusing a Loader" + ); + } + // Unload the loader, in case something was already loaded. loader_info_object.unload(activation); @@ -229,6 +240,17 @@ pub fn load_bytes<'gc>( let loader_info_object = loader_info.as_loader_info_object().unwrap(); + if loader_info_object.init_event_fired() { + // FIXME: When calling load/loadBytes, then calling load/loadBytes again + // before the `init` event is fired, the first load is cancelled. + avm2_stub_method!( + activation, + "flash.display.Loader", + "loadBytes", + "reusing a Loader" + ); + } + // Unload the loader, in case something was already loaded. loader_info_object.unload(activation);