diff options
author | PikalaxALT <PikalaxALT@users.noreply.github.com> | 2020-11-03 09:28:45 -0500 |
---|---|---|
committer | GitHub <noreply@github.com> | 2020-11-03 09:28:45 -0500 |
commit | 99dd461befcfe3bef3ce188fea2fb372c2f21b98 (patch) | |
tree | 2b0198d394186c371987f018677d12f929a66a44 /src/battle_script_commands.c | |
parent | 9e55ae22b19d58eca8fc0cdd2fcea9f2cca14319 (diff) | |
parent | ca950a8daf6dd95ab5dacc51f250fea7b605361c (diff) |
Merge pull request #1189 from aaaaaa123456789/reverts
Undo PokeCodec's PRs and port changes
Diffstat (limited to 'src/battle_script_commands.c')
-rw-r--r-- | src/battle_script_commands.c | 27 |
1 files changed, 15 insertions, 12 deletions
diff --git a/src/battle_script_commands.c b/src/battle_script_commands.c index 3b77df294..d43ddd5a2 100644 --- a/src/battle_script_commands.c +++ b/src/battle_script_commands.c @@ -3518,7 +3518,7 @@ static void Cmd_unknown_24(void) if (HP_count == 0) gBattleOutcome |= B_OUTCOME_LOST; - + HP_count = 0; for (i = 0; i < PARTY_SIZE; i++) @@ -3535,14 +3535,17 @@ static void Cmd_unknown_24(void) if (gBattleOutcome == 0 && (gBattleTypeFlags & (BATTLE_TYPE_LINK | BATTLE_TYPE_x2000000))) { - s32 foundPlayer = 0, foundOpponent; + s32 foundPlayer = 0; + s32 foundOpponent; + for (i = 0; i < gBattlersCount; i += 2) { if ((gHitMarker & HITMARKER_FAINTED2(i)) && (!gSpecialStatuses[i].flag40)) foundPlayer++; } - + foundOpponent = 0; + for (i = 1; i < gBattlersCount; i += 2) { if ((gHitMarker & HITMARKER_FAINTED2(i)) && (!gSpecialStatuses[i].flag40)) @@ -3552,14 +3555,14 @@ static void Cmd_unknown_24(void) if (gBattleTypeFlags & BATTLE_TYPE_MULTI) { if (foundOpponent + foundPlayer > 1) - gBattlescriptCurrInstr = (u8*) T2_READ_32(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); else gBattlescriptCurrInstr += 5; } else { if (foundOpponent != 0 && foundPlayer != 0) - gBattlescriptCurrInstr = (u8*) T2_READ_32(gBattlescriptCurrInstr + 1); + gBattlescriptCurrInstr = T2_READ_PTR(gBattlescriptCurrInstr + 1); else gBattlescriptCurrInstr += 5; } @@ -4660,10 +4663,8 @@ static void Cmd_jumpifcantswitch(void) || (gStatuses3[gActiveBattler] & STATUS3_ROOTED))) { gBattlescriptCurrInstr = T1_READ_PTR(gBattlescriptCurrInstr + 2); - return; } - - if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) + else if (gBattleTypeFlags & BATTLE_TYPE_INGAME_PARTNER) { #ifndef NONMATCHING asm("":::"r5"); @@ -5536,8 +5537,8 @@ static void Cmd_hitanimation(void) static u32 GetTrainerMoneyToGive(u16 trainerId) { u32 i = 0; + u32 lastMonLevel = 0; u32 moneyReward; - u8 lastMonLevel = 0; if (trainerId == TRAINER_SECRET_BASE) { @@ -6037,7 +6038,7 @@ static void PutLevelAndGenderOnLvlUpBox(void) printerTemplate.currentY = 0; printerTemplate.letterSpacing = 0; printerTemplate.lineSpacing = 0; - printerTemplate.style = 0; + printerTemplate.unk = 0; printerTemplate.fgColor = TEXT_COLOR_WHITE; printerTemplate.bgColor = TEXT_COLOR_TRANSPARENT; printerTemplate.shadowColor = TEXT_COLOR_DARK_GREY; @@ -7128,6 +7129,7 @@ static void Cmd_forcerandomswitch(void) s32 i; s32 battler1PartyId = 0; s32 battler2PartyId = 0; + s32 firstMonId; s32 lastMonId = 0; // + 1 s32 monsCount; @@ -7249,10 +7251,11 @@ static void Cmd_forcerandomswitch(void) { i = Random() % monsCount; i += firstMonId; - } while (i == battler2PartyId || i == battler1PartyId); + } + while (i == battler2PartyId || i == battler1PartyId); } while (GetMonData(&party[i], MON_DATA_SPECIES) == SPECIES_NONE || GetMonData(&party[i], MON_DATA_IS_EGG) == TRUE - || GetMonData(&party[i], MON_DATA_HP) == 0); // Should be one while loop, conjoined by an ||, but that doesn't match. Equivalent logic though + || GetMonData(&party[i], MON_DATA_HP) == 0); //should be one while loop, but that doesn't match. } *(gBattleStruct->monToSwitchIntoId + gBattlerTarget) = i; |