From 39d7c318316f663a3632553d813693fd8fe3adfd Mon Sep 17 00:00:00 2001 From: Philippe Symons Date: Fri, 26 Jul 2024 19:58:13 +0200 Subject: [PATCH] Update libpokemegb git submodule to fix bug MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug was reported by /u/imranFZakhaev on reddit: When adding a pokémon to a save with a full party, the behaviour is completely broken. Not only did we add a pokémon to every box, but it also would be a completely different one or even crash the game when trying to access the box. Fixes: - Stop after adding a pokemon to a box. Don't add it to all. - In commit 77d5d15 I added a ::setPokemon function and reworked the Gen1Box::add() function to use it. That's where it went wrong: in the add() function, we would modify the number_of_pokemon counter of the box, but not manipulate the species list and write it. Then in the setPokemon() function, we would read the box metadata and correct it because the number did not match the species list. This is what went wrong. To fix it, I just had to modify the species list in the add() function as well again. --- libpokemegb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libpokemegb b/libpokemegb index b275d12..7ac7c29 160000 --- a/libpokemegb +++ b/libpokemegb @@ -1 +1 @@ -Subproject commit b275d12a974bb1df92edf38e5bb32267339469ad +Subproject commit 7ac7c29f3e8b6477ecbf7df50e68d553daa25e0d