pokered-gbc icon indicating copy to clipboard operation
pokered-gbc copied to clipboard

party menu HP bar palette bug

Open xCrystal opened this issue 9 years ago • 3 comments

Basically when you use a healing item on a party mon the hp bar that is recolored (red-yellow-green transition) is always the bar of the first pokemon. This is because it checks wCurrentMenuItem to find out which mon index it has to deal with, but wCurrentMenuItem gets cleared at some point during RemoveItemFromInventary. I'm too lazy to sumbit a PR but I got around it by just using wLastMenuItem like this: https://github.com/xCrystal/pokered/commit/bac1427 (though I'm not absolutely 100% sure that I didn't break something else in the process)

xCrystal avatar Nov 25 '15 22:11 xCrystal

Interesting bug. Thanks for pointing it out.

dannye avatar Nov 26 '15 13:11 dannye

The recent update has brought back this bug (it was originally fixed in https://github.com/dannye/pokered-gbc/commit/1531f6b3e321b4bd728521ba1ae6a4177d8ce7d0). When the last unit of an item is used, wCurrentMenuItem is set back to 0, causing healing items to animate the first Pokemon's palette always. The bug was reintroduced in https://github.com/dannye/pokered-gbc/commit/83f6d5ed44ef9513df25d68295394134d510a758. To fix, replace the two wCurrentMenuItem reads in DrawHPBarWithColor with wLastMenuItem.

I'm going through all the commits to port some things to my own hack (I'm mostly interested in low level engine changes than data changes but that's another story). The point is, if I notice anything else I'll point it out as well, but it could obviously be related to my own hack changes as well. I assume this particular bug is a thing in the clean color hack too since it used to be a bug for the same reasons.

For example, I think in was https://github.com/dannye/pokered-gbc/commit/bfd0d7a4186b275a1102235449c0be63d1ae5654 which introduced a bug in my own version when sending a player Pokemon into battle (it was an issue with the bank not being restored properly but I didn't look further into it, since I had patched the pokemart corruption glitch with another far less clean solution that didn't involve clearing the di/ei block, so I just went back to it instead). I'm not sure if it could be due to interrupts timing in DelayFrameHook and/or if it's a thing in the clean color hack at all and it was fixed in a latter commit.

xCrystal avatar Aug 08 '17 10:08 xCrystal

dang it. forgot to come back to this and no one else has reported it for 5 years lol but confirmed it is still happening.

dannye avatar May 18 '22 17:05 dannye