ruffle-rs / ruffle

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

Flight: Upgrade screen invokes epilepsy #10443

Open HeyBanditoz opened 1 year ago

HeyBanditoz commented 1 year ago

Describe the bug

SWF: https://www.gameszap.com/files/swf/flight-1509798285.swf (also attached to issue at flight-1509798285.zip)

At the plane upgrade screen, all the upgrade and achievements cycles between different images (sprites?) very fast. Error Log (the mouseOver and click errors only seem to happen when moving mouse over an upgrade, or clicking one, maybe a different issue?) https://user-images.githubusercontent.com/7574664/228444224-11be736a-b8ee-4db8-b5fb-f6c6193b9467.mp4

Reproduction Steps

  1. Load the game.
  2. Create a new save.
  3. Fly the plane, try to crash it.
  4. Click next to skip the after-flight stats.
  5. Observe the bug.

Expected behavior

For the upgrades screen to look like this instead: image

Affected platform

Linux build of nightly-2023-03-29, but observed on web too.

Operating system

Linux

Additional information

$ lspci | grep VGA
00:02.0 VGA compatible controller: Intel Corporation TigerLake-LP GT2 [Iris Xe Graphics] (rev 01)
n0samu commented 1 year ago

This is another issue caused by Class.hasOwnProperty being unimplemented. (And it will be very difficult to implement AFAIK.)

mara004 commented 1 year ago

10864 sounds related

n0samu commented 1 year ago

It does sound related, but that's XML.hasOwnProperty, not Class.hasOwnProperty. #10812 fixes Class.hasOwnProperty, but it unfortunately doesn't seem to help this game (besides getting rid of the error message). The new errors are:

ERROR ruffle_core::display_object::movie_clip: Error occured when running AVM2 frame script: TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: 0)
        at Flight_fla::UpgradeButton_156/setTip()
        at Flight_fla::UpgradeButton_156/init()
        at UpgradeScreen/frame1()
        at flash.display::MovieClip/flash::display::MovieClip::gotoAndStop()
        at Flight_fla::MainTimeline/endTrans()
        at Transit/frame3()
ERROR ruffle_core::avm2::events: Error dispatching event EventObject(EventObject { type: "mouseOver", class: flash.events::MouseEvent, ptr: 0x283e0100d28 }) to handler FunctionObject(FunctionObject { ptr: 0x283fd9e15b8 }) : TypeError: Error #1009: Cannot access a property or method of a null object reference. (accessing field: tipName)
        at ToolTip$/tip()
        at Flight_fla::UpgradeButton_156/showTip()
Esortsyt commented 7 months ago

If this bug could be addressed and fixed that would be great.

Aaron1011 commented 7 months ago

This is a tricky framescript issue - in flash player, the framescript for UpgradeButton_156 somehow runs before the framescript of the parent UpgradeScreen. The swf relies on this, since the UpgradeButton_156 framescript initializes this.romanNum, which is relied on by the UpgradeScreen framescript.