increpare / PuzzleScript

Open Source HTML5 Puzzle Game Engine
MIT License
903 stars 159 forks source link

Checkpoint causes the same level to be played again and again #773

Closed ClementSparrow closed 3 years ago

ClementSparrow commented 3 years ago

to reproduce:

The reason seems to be that curlevelTarget is set when the page loads and a checkpoint is found in local storage, and again when the title screen is displayed, but it will be set to null only when a new game is started, the end of the game is reached, a specific level is loaded from the editor, or a checkpoint has been reached in the level that we just won. So if we load a game from a checkpoint and then complete the level without triggering another checkpoint, the next level will be loaded and then replaced with the content of curlevelTarget that has not been set to null.

Additional remark: the bug will not appear if the level state saved after a checkpoint triggers another checkpoint after it's loaded. So if you just place a checkpoint with a rule like late [ player checkpointPosition ] -> checkpoint, the bug will not appear.

increpare commented 3 years ago

Thanks for the detailed report. Helped me track it down pretty quickly :)

ClementSparrow commented 3 years ago

Mhhh... The bug still happens, for me. It seems you forgot to recompile the scripts?

increpare commented 3 years ago

I, thanks for checking. I indeed hadn't recompiled/reuploaded stuff to puzzlescript.net, but have now following your comment. I did verify it locally, and just now ( cf https://www.puzzlescript.net/play.html?p=fdcecb898c389f89e5ca6a0e2685d011 - you may have to force-reload to get the fixed version). I haven't verified that it's good with the fully standalone version, but I'd guess it should be.

Funny that the bug didn't come up before now.

If you notice any problems, let me know - thanks again for the heads up :)

S

Am So., 22. Aug. 2021 um 20:32 Uhr schrieb ClementSparrow < @.***>:

Mhhh... The bug still happens, for me. It seems you forgot to recompile the scripts?

— You are receiving this because you modified the open/close state. Reply to this email directly, view it on GitHub https://github.com/increpare/PuzzleScript/issues/773#issuecomment-903311300, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADRVYH2GBM32IHGBSFKPQDT6E7FNANCNFSM5CR36R2A . Triage notifications on the go with GitHub Mobile for iOS https://apps.apple.com/app/apple-store/id1477376905?ct=notification-email&mt=8&pt=524675 or Android https://play.google.com/store/apps/details?id=com.github.android&utm_campaign=notification-email .