Use non-preproc guards on AI frame count

Co-authored-by: hedara90 <90hedara@gmail.com>
This commit is contained in:
aronson 2025-03-31 12:06:12 -05:00 committed by GitHub
parent 926a7437da
commit 692f7968fc
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 6 additions and 9 deletions

View File

@ -473,9 +473,8 @@ void SetAiLogicDataForTurn(struct AiLogicData *aiData)
battlersCount = gBattlersCount;
AI_DATA->aiCalcInProgress = TRUE;
#if DEBUG_AI_DELAY_TIMER
CycleCountStart();
#endif
if (DEBUG_AI_DELAY_TIMER)
CycleCountStart();
for (battlerAtk = 0; battlerAtk < battlersCount; battlerAtk++)
{
if (!IsBattlerAlive(battlerAtk))
@ -491,10 +490,9 @@ void SetAiLogicDataForTurn(struct AiLogicData *aiData)
SetBattlerAiMovesData(aiData, battlerAtk, battlersCount, weather);
}
#if DEBUG_AI_DELAY_TIMER
// We add to existing to compound multiple calls
gBattleStruct->aiDelayCycles += CycleCountEnd();
#endif
if (DEBUG_AI_DELAY_TIMER)
// We add to existing to compound multiple calls
gBattleStruct->aiDelayCycles += CycleCountEnd();
AI_DATA->aiCalcInProgress = FALSE;
}

View File

@ -2011,7 +2011,7 @@ static void HandleChooseActionAfterDma3(u32 battler)
{
gBattleStruct->aiDelayFrames = gMain.vblankCounter1 - gBattleStruct->aiDelayTimer;
gBattleStruct->aiDelayTimer = 0;
#if DEBUG_AI_DELAY_TIMER
if (DEBUG_AI_DELAY_TIMER)
{
static const u8 sFramesText[] = _(" frames thinking\n");
static const u8 sCyclesText[] = _(" cycles");
@ -2023,7 +2023,6 @@ static void HandleChooseActionAfterDma3(u32 battler)
StringAppend(gDisplayedStringBattle, sCyclesText);
BattlePutTextOnWindow(gDisplayedStringBattle, B_WIN_ACTION_PROMPT);
}
#endif // DEBUG_AI_DELAY_TIMER
}
gBattlerControllerFuncs[battler] = HandleInputChooseAction;
}