Solarus Forum

Solarus => Development => Topic started by: Starlock on August 08, 2018, 04:37:45 am

Title: Problem with thrown enemies after pause
Post by: Starlock on August 08, 2018, 04:37:45 am
When I lift a destructible object, and then pause and check the Info of an item, the action command no longer allows the hero to thrown the object. This only seems to happen when the info message is used. Does anybody have any idea what could be a likely cause of this?

EDIT: I've tested it further, and this will happen no matter what whenever any dialog is opened while paused
Title: Re: Problem with thrown enemies after pause
Post by: Christopho on August 08, 2018, 09:08:24 am
Which Solarus version are you using? Which game and which version of that game?
Title: Re: Problem with thrown enemies after pause
Post by: Starlock on August 08, 2018, 04:47:32 pm
I'm using 1.5.0, since any version higher than that causes an issue with one of my custom entities. It's a problem happening on my own game.
Title: Re: Problem with thrown enemies after pause
Post by: Christopho on August 08, 2018, 06:36:40 pm
The bug also happens in my games and still with 1.6. I guess we had never noticed before :)
https://gitlab.com/solarus-games/zelda-xd2-mercuris-chess/issues/133
Title: Re: Problem with thrown enemies after pause
Post by: Max on August 09, 2018, 12:38:28 am
I also have this problem in my game, which I think is 1.5.3? I don't think I ever solved the issue, but I'll look into what I found out once I get home.
Title: Re: Problem with thrown enemies after pause
Post by: Max on August 09, 2018, 04:38:28 am
Just to confirm, I still have this issue also. 1.5.1, though.

I did some testing a while ago, and my suspicion is that game:set_paused(false) puts the hero in an "idle" state instead of in a "carrying" state? Anyway, I think I traced the issue to game:set_paused(false), but then I forgot and never fixed it.

To reproduce it on my end, my pause screen shows a dialog and some images (that's all it does), and every time I pause when carrying an item, I get this bug.

Question- does swinging your sword force the item to be thown and reset the action button? That's how it works for me, which "solves" the issue but it's still a bug.

Title: Re: Problem with thrown enemies after pause
Post by: Starlock on August 09, 2018, 04:56:39 am
Yeah, using the sword causes the hero to throw the carried object.
Title: Re: Problem with thrown enemies after pause
Post by: Diarandor on August 09, 2018, 05:16:39 pm
That (i.e. the hero throwing the item) can be avoided if you add some code to the corresponding event(s) on_key/command_pressed().
Title: Re: Problem with thrown enemies after pause
Post by: Max on August 09, 2018, 07:04:23 pm
Well right now, the fact that the hero throws an item on swinging the sword is the only thing that keeps this bug from being game-breaking, so maybe don't address that issue yet, haha. Also it makes sense, if you've got a shoebox or whatever in your hand then you suddenly swing a weapon you'd probably drop the shoebox :p