JJM152 / Queen

Queen of the Seas Game
GNU General Public License v2.0
12 stars 13 forks source link

Eating food in cabin can send you back to a previous location #41

Closed JJM152 closed 6 years ago

JJM152 commented 6 years ago

Erratic bug - eating food will occasionally send you to the wrong bookmark location, which should be impossible.

Might be a sugarcube related bug with the state history.

another report Just replicated the position thing on first attempt: bought food from Cookie, went to cabin, rested until night (twice I think), went to food, ate one or two stew, click exit, wind up back at Cookie. Nutrition was below three, I ate to get it up to 3.

ezsh commented 6 years ago

Might be a sugarcube related bug with the state history.

I compile with Tweego 1.3.0/Sugarcube 2.27.0 and have never encountered anything like that.

JJM152 commented 6 years ago

I've seen it a couple of times, even recently, using sugarcube 2.24.0 but I haven't figured out how to reliably trigger it.

Literally the worst kind of bug.

JJM152 commented 6 years ago

User still reporting this as a problem in test release.

I'm going to assume this is a bug in the SugarCube state engine and therefor I'm going to write some custom code in the window namespace to handle this.

That's the only thing I can think of at this point.

JJM152 commented 6 years ago

@ezsh before I go and rewrite all this, could you quickly cast your eyes over it and see if anything jumps out at you?

ezsh commented 6 years ago

I can neither find anything suspicious nor reproduce this. Tried various browsers, downloading official release, building the file myself. My suggestion is to add logging to the GameBookmark manipulations before rewriting and try to get logs from those who can make the bug happen.

ezsh commented 6 years ago

My suggestion is to add logging to the GameBookmark manipulations

They do that by themselves already, huh?

ezsh commented 6 years ago

The sequence to reproduce the bug:

  1. Start the game
  2. Rest.
  3. Without cliking "Exit" in the resting passage, click "Inventory".
  4. Click "Exit".
ezsh commented 6 years ago

This helps:

diff --git a/src/201-UI/Rest.twee b/src/201-UI/Rest.twee
index cffafb5..212b023 100644
--- a/src/201-UI/Rest.twee
+++ b/src/201-UI/Rest.twee
@@ -1,4 +1,5 @@
 :: Rest [custom-menu]
+<<set $GameBookmark = passage();>>
 <<run setup.player.Rest();>>You recline leisurely in your room. There isn't much to do so you after a few minutes you find yourself napping and trying to escape into your fantasies...

 You wake up not long after, feeling slightly more energetic.
JJM152 commented 6 years ago

Yup, sometimes two pairs of eyes really help.

I think the correct way to do this is to replace the tokens [[Rest]] and [[Sleep]] in the Cabin description with the customMenuLink widget.

Thanks for that.

ezsh commented 6 years ago

My pleasure.