silverweed / pokepon

A Pokémon-like online battle simulator with ponies
Other
5 stars 1 forks source link

Using Magic Shield then causing stat removal disconnects both battlers from the server #6

Open RedEnchilada opened 9 years ago

RedEnchilada commented 9 years ago

Tested methods to cause stat removal include switching out the user (either manually or through an opponent's Scare Away) and using Spa Treatment to heal status effects. Server logs indicate both battlers send null msgs, and connections are then forcefully terminated. Suspecting a bug related to stat removal routines for the speed lowering or something similar?

RedEnchilada commented 9 years ago

Found another trigger case for the bug: paralyzing a foe who then uses Nap to remove negative status effects. When running the client with the debug panel open, it complains about an uncaught exception in Connection.run. I have a hunch the error is triggered by something within the handling of rmstatus messages with no status argument (so, "heal all" messages), https://github.com/silverweed/pokepon/blob/master/gui/BattlePanel.java#L1704 and the crash happened before the "{opp} healed!" message displayed. HIGHLY SUSPECT either Pony.healStatus() or HPBar.clearStatuses() is the cause.

silverweed commented 9 years ago

It seems like this bug happens a bit randomly, because with a couple of tries I couldn't reproduce it. However, I believe it's due to missing null checks on ponies and HPBars, which I have added just now. If this doesn't solve the issue, would you mind taking a screenshot of the error, please? Anyway, I'll test this further when I have time.