Open fsvgm777 opened 2 years ago
The game.dat variables are loaded into _root
, but the game.dat includes:
...&constructor=[type Function]&__proto__=[object Object]&...
which wipes out the proto of _root
and causes havoc. Deleting those variables from game.dat causes the game to function.
When proto gets stomped, _root.gotoAndStop(5);
has no effect, and the loading screen gets stuck.
Looked into this a bit more, and the Flash Player behavior is really bizarre. Display objects in AVM1 seem to be able to "heal" their proto property:
_root.__proto__
when loading variables into _root
in this way._root
, the __proto__
magically fixes itself somehow.__proto__
to a primitive value. If you do _root.__proto__ = {};
, it sticks forever.Sample:
trace(_root.__proto__); // [object Object]
_root.__proto__ = "bad";
trace(_root.__proto__); // "bad"
trace(_root.__proto__.gotoAndStop); // undefined
trace(_root.gotoAndStop); // [type Function] -- proto healed???
trace(_root.__proto__); // [object Object]
trace(_root.__proto__.gotoAndStop); // [type Function]
Likely I'm missing some part of the behavior here, so this needs more investigation.
Describe the bug
In Ruffle, the game hangs on this screen upon clicking on "HRÁT":![image](https://user-images.githubusercontent.com/14264196/163437946-7550395f-5650-430d-a5a4-0661f8e9b035.png)
Expected behavior
The game is supposed to load the level proper upon clicking on "HRÁT".
Affected platform
Desktop app
Operating system
Windows 10 x64
Browser
No response
Additional information
It should be noted that Adobe Flash Player does not have the issue.
The game itself comes with an external game.dat, which I might assume it tries to load upon clicking on "HRÁT", but it doesn't load it in Ruffle.
Here's a ZIP with the game and the game.dat twistergame.zip :