Selaa lähdekoodia

Merge pokemon_trading from https://github.com/kbembedded/Flipper-Zero-Game-Boy-Pokemon-Trading

# Conflicts:
#	pokemon_trading/application.fam
Willy-JL 1 vuosi sitten
vanhempi
commit
e786599a10

+ 1 - 1
pokemon_trading/application.fam

@@ -5,7 +5,7 @@ App(
     entry_point="pokemon_app",
     requires=["gui"],
     stack_size=2 * 1024,
-    fap_version=[2, 2],
+    fap_version=[2, 3],
     fap_category="GPIO",
     fap_icon="pokemon_10px.png",
     fap_icon_assets="assets",

+ 3 - 0
pokemon_trading/changelog.md

@@ -1,5 +1,8 @@
 # Changelog - Patch Notes
 
+## Version 2.3
+- Fix potential bug in copying incoming trade data to the live working struct
+
 ## Version 2.2
 **New Features**
 - Update to gblink v0.63 which includes saving/loading of pin configurations for the EXT link interface

+ 3 - 3
pokemon_trading/src/pokemon_data.c

@@ -896,12 +896,12 @@ void pokemon_stat_memcpy(PokemonData* dst, PokemonData* src, uint8_t which) {
             &(((TradeBlockGenI*)src->trade_block)->ot_name[which]),
             sizeof(struct name));
     } else if(dst->gen == GEN_II) {
-        ((TradeBlockGenI*)dst->trade_block)->party_members[0] =
-            ((TradeBlockGenI*)src->trade_block)->party_members[which];
+        ((TradeBlockGenII*)dst->trade_block)->party_members[0] =
+            ((TradeBlockGenII*)src->trade_block)->party_members[which];
         memcpy(
             &(((TradeBlockGenII*)dst->trade_block)->party[0]),
             &(((TradeBlockGenII*)src->trade_block)->party[which]),
-            sizeof(PokemonPartyGenI));
+            sizeof(PokemonPartyGenII));
         memcpy(
             &(((TradeBlockGenII*)dst->trade_block)->nickname[0]),
             &(((TradeBlockGenII*)src->trade_block)->nickname[which]),