Allowed rematches to occur if I_VS_SEEKER_CHARGING isn't enabled (#4866)
This commit is contained in:
parent
3ec371de05
commit
6957fc70c9
3 changed files with 19 additions and 9 deletions
|
@ -8,6 +8,7 @@ bool8 UpdateVsSeekerStepCounter(void);
|
|||
void MapResetTrainerRematches(u16 mapGroup, u16 mapNum);
|
||||
void ClearRematchMovementByTrainerId(void);
|
||||
u16 GetRematchTrainerIdVSSeeker(u16 trainerId);
|
||||
bool32 IsVsSeekerEnabled(void);
|
||||
|
||||
#define VSSEEKER_RECHARGE_STEPS 100
|
||||
|
||||
|
|
|
@ -1916,15 +1916,16 @@ static bool32 HasAtLeastFiveBadges(void)
|
|||
void IncrementRematchStepCounter(void)
|
||||
{
|
||||
#if FREE_MATCH_CALL == FALSE
|
||||
if (HasAtLeastFiveBadges()
|
||||
&& (I_VS_SEEKER_CHARGING != 0)
|
||||
&& (!CheckBagHasItem(ITEM_VS_SEEKER, 1)))
|
||||
{
|
||||
if (!HasAtLeastFiveBadges())
|
||||
return;
|
||||
|
||||
if (IsVsSeekerEnabled())
|
||||
return;
|
||||
|
||||
if (gSaveBlock1Ptr->trainerRematchStepCounter >= STEP_COUNTER_MAX)
|
||||
gSaveBlock1Ptr->trainerRematchStepCounter = STEP_COUNTER_MAX;
|
||||
else
|
||||
gSaveBlock1Ptr->trainerRematchStepCounter++;
|
||||
}
|
||||
#endif //FREE_MATCH_CALL
|
||||
}
|
||||
|
||||
|
|
|
@ -577,6 +577,14 @@ u16 GetRematchTrainerIdVSSeeker(u16 trainerId)
|
|||
return gRematchTable[tableId].trainerIds[rematchTrainerIdx];
|
||||
}
|
||||
|
||||
bool32 IsVsSeekerEnabled(void)
|
||||
{
|
||||
if (I_VS_SEEKER_CHARGING == 0)
|
||||
return FALSE;
|
||||
|
||||
return (CheckBagHasItem(ITEM_VS_SEEKER, 1));
|
||||
}
|
||||
|
||||
static bool8 ObjectEventIdIsSane(u8 objectEventId)
|
||||
{
|
||||
struct ObjectEvent *objectEvent = &gObjectEvents[objectEventId];
|
||||
|
|
Loading…
Reference in a new issue