ruffle-rs / ruffle

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

Roads Of Rome 3: Cannot access a property or method of a null object reference (base.core::NCore/onXmlsLoaded()) #17726

Open MartySVK opened 1 month ago

MartySVK commented 1 month ago

Describe the bug

The game is broken in the menu.

Error dispatching event EventObject(EventObject { type: "xmls_loaded", class: flash.events::Event, ptr: 0x2c26008 }) to handler FunctionObject(FunctionObject { ptr: 0x278eb60, name: Ok("base.core::NCore/onXmlsLoaded()") }) : TypeError: Error #1009: Cannot access a property or method of a null object reference.
at com.whiterra.ror3.dialogs::EnterNameDlg/Init()
at com.whiterra.ror3.dialogs::MainMenuDlg/OnSceneEvent()
at base.core::NCore/TransitionComplete()
at base.core::NCore/StartTransitionTo()
at base.core::NCore/SwitchTo()
at com.whiterra.ror3::RORCore/InitScenes()
at com.whiterra.ror3::RORCore/Init()
at base.core::NCore/onXmlsLoaded()
at flash.events::EventDispatcher/flash::events::EventDispatcher::dispatchEvent()
at base.managers::XmlManager/LoadXmls() at base.core::NCore/OnAdded()
at flash.display::DisplayObjectContainer/flash::display::DisplayObjectContainer::addChild()
at com.whiterra.ror3::Main/init()
at flash.display::DisplayObjectContainer/flash::display::DisplayObjectContainer::addChild()
at com.whiterra.ror3::Preloader/startup()
at com.whiterra.ror3::Preloader/checkFrame()

Expected behavior

progress the game

Content Location

Game URL - https://www.gameflare.com/online-game/roads-of-rome-3/ SWF URL - https://data.gameflare.com/games/2893/TIG0WIgm2DgLcf.swf

Affected platform

Desktop app

Operating system

Windows 11

Browser

No response

Additional information

No response

Aaron1011 commented 1 month ago

It looks like EnterNameDlg.Init is trying to access the null field this.mCancelBtn. It should be initialized when OnSceneEvent is called with NSceneEvent.evtControlsLoaded, but that somehow isn't happening.

My guess is that the xml acceses in NScene.ParseXML are getting the wrong data, so it isn't calling this.OnSceneEvent(NSceneEvent.evtControlsLoaded,null)