Change map header flags to use a bitfield

This commit is contained in:
ExpoSeed
2021-06-13 16:32:00 -05:00
parent f85fb3af89
commit b6b0062bd6
5 changed files with 12 additions and 16 deletions

View File

@@ -1053,7 +1053,7 @@ void Bike_HandleBumpySlopeJump(void)
bool32 IsRunningDisallowed(u8 metatile)
{
if (!(gMapHeader.flags & MAP_ALLOW_RUNNING) || IsRunningDisallowedByMetatile(metatile) == TRUE)
if (!gMapHeader.allowRunning || IsRunningDisallowedByMetatile(metatile) == TRUE)
return TRUE;
else
return FALSE;

View File

@@ -910,7 +910,7 @@ static void ItemUseOnFieldCB_EscapeRope(u8 taskId)
bool8 CanUseDigOrEscapeRopeOnCurMap(void)
{
if (gMapHeader.flags & MAP_ALLOW_ESCAPING)
if (gMapHeader.allowEscaping)
return TRUE;
else
return FALSE;

View File

@@ -962,7 +962,7 @@ static u16 GetCenterScreenMetatileBehavior(void)
bool32 Overworld_IsBikingAllowed(void)
{
if (!(gMapHeader.flags & MAP_ALLOW_CYCLING))
if (!gMapHeader.allowCycling)
return FALSE;
else
return TRUE;
@@ -1687,7 +1687,7 @@ void CB2_ReturnToFieldFadeFromBlack(void)
static void FieldCB_FadeTryShowMapPopup(void)
{
if (SHOW_MAP_NAME_ENABLED && SecretBaseMapPopupEnabled() == TRUE)
if (gMapHeader.showMapName == TRUE && SecretBaseMapPopupEnabled() == TRUE)
ShowMapNamePopup();
FieldCB_WarpExitFadeFromBlack();
}
@@ -1933,7 +1933,7 @@ static bool32 LoadMapInStepsLocal(u8 *state, bool32 a2)
(*state)++;
break;
case 11:
if (SHOW_MAP_NAME_ENABLED && SecretBaseMapPopupEnabled() == TRUE)
if (gMapHeader.showMapName == TRUE && SecretBaseMapPopupEnabled() == TRUE)
ShowMapNamePopup();
(*state)++;
break;

View File

@@ -1007,7 +1007,7 @@ static void InitMapBasedOnPlayerLocation(void)
break;
case MAP_TYPE_UNDERGROUND:
case MAP_TYPE_UNKNOWN:
if (gMapHeader.flags & MAP_ALLOW_ESCAPING)
if (gMapHeader.allowEscaping)
{
mapHeader = Overworld_GetMapHeaderByGroupAndId(gSaveBlock1Ptr->escapeWarp.mapGroup, gSaveBlock1Ptr->escapeWarp.mapNum);
gRegionMap->mapSecId = mapHeader->regionMapSectionId;