Merge pull request #1700 from mrgriffin/battle-setup-water-transition

Simplify GetBattleTransitionTypeByMap
This commit is contained in:
GriffinR 2022-07-05 11:10:16 -04:00 committed by GitHub
commit 76659a4091
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -699,10 +699,13 @@ static u8 GetBattleTransitionTypeByMap(void)
PlayerGetDestCoords(&x, &y);
tileBehavior = MapGridGetMetatileBehaviorAt(x, y);
if (GetFlashLevel())
return TRANSITION_TYPE_FLASH;
if (!MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior))
{
if (MetatileBehavior_IsSurfableWaterOrUnderwater(tileBehavior))
return TRANSITION_TYPE_WATER;
switch (gMapHeader.mapType)
{
case MAP_TYPE_UNDERGROUND:
@ -712,8 +715,6 @@ static u8 GetBattleTransitionTypeByMap(void)
default:
return TRANSITION_TYPE_NORMAL;
}
}
return TRANSITION_TYPE_WATER;
}
static u16 GetSumOfPlayerPartyLevel(u8 numMons)