Auroriax / PuzzleScriptPlus

Puzzlescript Plus: Open Source HTML5 Puzzle Game Engine (with lots of extra functionality)
https://auroriax.github.io/PuzzleScript/
34 stars 4 forks source link

If `again` and `win` are triggered together, the `win` is lost #121

Open david-pfx opened 10 months ago

david-pfx commented 10 months ago

Here is the repro case. Press Right 3 times. On vanilla PS and P:S this triggers a win, but not on PS+.

test_ps_winbug.txt

The bug seems to be during again processing. I haven't nailed it yet.

david-pfx commented 10 months ago

Finally nailed it!!! At engine.js:3324 the return is taken before changes to the level have been restored. So the combo of again, win and changes to the level will trigger the bug. The fix is to delete those 3 lines.😎