ruffle-rs / ruffle

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

Desktop Tower Defense does not conclude after surviving all levels. #9052

Open kfchou opened 1 year ago

kfchou commented 1 year ago

Describe the bug

Desktop Tower Defense does not conclude after surviving all levels.

Expected behavior

After beating the game, a pop up appears with score submission, or a message that the game has concluded, and return to main menu.

Affected platform

Online demo

Operating system

Windows 10

Browser

Chrome

Additional information

The version of the game is hosted on https://kbhgames.com/game/desktop-tower-defense

CUB3D commented 1 year ago

This is another case of #5492, when a 'creep' is defeated it's clip is removed, these are then filtered from the creep list like so:

function FilterCreeps() {
    var i = 0;
    while(i < this.creeps.length) {
        if("" + this.creeps[i] == "") {
            this.creeps.splice(i, 1);
        } else {
            i++;
        }
    }
}

In Ruffle the strings won't get changed when the clip is removed so creeps.length == 429, but Tick() does the following check:

if(this.finished && this.creeps.length == 0)  {
    this.ShowFinish();
}

Which will never get hit in Ruffle, so the pop up won't show.