landgreen / n-gon

2-d physics rogue-lite platformer shooter
https://landgreen.github.io/n-gon/
GNU General Public License v3.0
151 stars 221 forks source link

Healing on subway sometimes sets health to 100 #261

Closed RustyBust closed 4 months ago

RustyBust commented 4 months ago

Sometimes, on the subway level (12 subway), my health randomly (I believe upon using the heal power-ups spawned at the beginning of the level, when already at full health?) will change to 10000/10000, allowing me to beat it and final quite easily. I have no idea why this might've happened, but I have a guess that it might be related to a line of code accidentally setting the m.health and/or m.maxHealth values to equal 100 somewhere (which would be 10000%). Also, the health bar does update on-screen when this happens.

AnnonymousNerd87 commented 4 months ago

I've never seen this happen before, can you provide screenshots of your build in the pause menu?

RustyBust commented 4 months ago

After commenting, I beat the game on that run and closed the tab. I'll try to reproduce this later today or tomorrow.

AnnonymousNerd87 commented 4 months ago

I would try to replicate it if I wasn't focused on my nuclear science project

On Fri, May 31, 2024 at 9:53 AM Rusty @.***> wrote:

After commenting, I beat the game on that run and closed the tab. I'll try to reproduce this later today or tomorrow.

— Reply to this email directly, view it on GitHub https://github.com/landgreen/n-gon/issues/261#issuecomment-2142642467, or unsubscribe https://github.com/notifications/unsubscribe-auth/BHEAKND4OUWW36WPA5MCSKDZFCTILAVCNFSM6AAAAABISFDYD6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZDCNBSGY2DENBWG4 . You are receiving this because you commented.Message ID: @.***>

landgreen commented 4 months ago

I didn't find anything that could cause that except a couple of unprotected lines of code in a community map.

I added this to those situations. if (m.health > m.maxHealth) m.health = m.maxHealth;

kgurchiek commented 4 months ago

if (m.health > m.maxHealth) m.health = m.maxHealth;

I think they said the bug affected max health as well, so that might not work

landgreen commented 4 months ago

I checked for maxHealth and health.

RustyBust commented 4 months ago

Could it be possible that I was running an old commit?

landgreen commented 4 months ago

maybe, but there was a potential issue for a community map.

4kh00 commented 4 months ago

I experienced that issue on an OLD, old commit. Probably, that's what's wrong.