From 60132b29fb125340b04bfdbe5832dbb98a23db98 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9rgio=20Augusto=20Vianna?= Date: Thu, 1 Sep 2022 15:21:30 -0300 Subject: [PATCH] Fixed pickup running when it shouldn't in some cases. --- src/battle_script_commands.c | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 2b65a61a072f..c0e7dd2e5e96 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -13313,10 +13313,7 @@ static void Cmd_pickup(void) species = GetMonData(&gPlayerParty[i], MON_DATA_SPECIES2); heldItem = GetMonData(&gPlayerParty[i], MON_DATA_HELD_ITEM); - if (GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM)) - ability = gBaseStats[species].abilities[1]; - else - ability = gBaseStats[species].abilities[0]; + ability = gBaseStats[species].abilities[GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM)]; if (ability == ABILITY_PICKUP && species != SPECIES_NONE @@ -13352,10 +13349,7 @@ static void Cmd_pickup(void) if (lvlDivBy10 > 9) lvlDivBy10 = 9; - if (GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM)) - ability = gBaseStats[species].abilities[1]; - else - ability = gBaseStats[species].abilities[0]; + ability = gBaseStats[species].abilities[GetMonData(&gPlayerParty[i], MON_DATA_ABILITY_NUM)]; if (ability == ABILITY_PICKUP && species != SPECIES_NONE