Skip to content

Commit

Permalink
Replace unusual heal location member names
Browse files Browse the repository at this point in the history
  • Loading branch information
GriffinRichards committed Sep 19, 2024
1 parent ecf27f4 commit 3ace518
Show file tree
Hide file tree
Showing 5 changed files with 12 additions and 12 deletions.
4 changes: 2 additions & 2 deletions include/heal_location.h
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@

struct HealLocation
{
s8 group;
s8 map;
s8 mapGroup;
s8 mapNum;
s16 x;
s16 y;
};
Expand Down
4 changes: 2 additions & 2 deletions src/field_screen_effect.c
Original file line number Diff line number Diff line change
Expand Up @@ -401,8 +401,8 @@ static void Task_RushInjuredPokemonToCenter(u8 taskId)

// Scene changes if last heal location was the player's house
loc = GetHealLocation(SPAWN_PALLET_TOWN);
if (gSaveBlock1Ptr->lastHealLocation.mapGroup == loc->group
&& gSaveBlock1Ptr->lastHealLocation.mapNum == loc->map
if (gSaveBlock1Ptr->lastHealLocation.mapGroup == loc->mapGroup
&& gSaveBlock1Ptr->lastHealLocation.mapNum == loc->mapNum
&& gSaveBlock1Ptr->lastHealLocation.warpId == WARP_ID_NONE
&& gSaveBlock1Ptr->lastHealLocation.x == loc->x
&& gSaveBlock1Ptr->lastHealLocation.y == loc->y)
Expand Down
2 changes: 1 addition & 1 deletion src/heal_location.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ static u32 GetHealLocationIndexFromMapGroupAndNum(u16 mapGroup, u16 mapNum)
u32 i;

for (i = 0; i < NELEMS(sSpawnPoints); i++) {
if (sSpawnPoints[i].group == mapGroup && sSpawnPoints[i].map == mapNum)
if (sSpawnPoints[i].mapGroup == mapGroup && sSpawnPoints[i].mapNum == mapNum)
{
return i + 1;
}
Expand Down
6 changes: 3 additions & 3 deletions src/overworld.c
Original file line number Diff line number Diff line change
Expand Up @@ -611,7 +611,7 @@ void SetWarpDestinationToHealLocation(u8 healLocationId)
{
const struct HealLocation *warp = GetHealLocation(healLocationId);
if (warp)
SetWarpDestination(warp->group, warp->map, -1, warp->x, warp->y);
SetWarpDestination(warp->mapGroup, warp->mapNum, -1, warp->x, warp->y);
}

void SetWarpDestinationToLastHealLocation(void)
Expand All @@ -628,7 +628,7 @@ void SetLastHealLocationWarp(u8 healLocationId)
{
const struct HealLocation *healLocation = GetHealLocation(healLocationId);
if (healLocation)
SetWarpData(&gSaveBlock1Ptr->lastHealLocation, healLocation->group, healLocation->map, -1, healLocation->x, healLocation->y);
SetWarpData(&gSaveBlock1Ptr->lastHealLocation, healLocation->mapGroup, healLocation->mapNum, -1, healLocation->x, healLocation->y);
}

void UpdateEscapeWarp(s16 x, s16 y)
Expand Down Expand Up @@ -690,7 +690,7 @@ void SetContinueGameWarpToHealLocation(u8 healLocationId)
{
const struct HealLocation *warp = GetHealLocation(healLocationId);
if (warp)
SetWarpData(&gSaveBlock1Ptr->continueGameWarp, warp->group, warp->map, -1, warp->x, warp->y);
SetWarpData(&gSaveBlock1Ptr->continueGameWarp, warp->mapGroup, warp->mapNum, -1, warp->x, warp->y);
}

void SetContinueGameWarpToDynamicWarp(int unused)
Expand Down
8 changes: 4 additions & 4 deletions tools/mapjson/mapjson.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,10 @@ void process_heal_locations(const vector<string> &map_filepaths, string output_f

// Add element to main heal locations array
heal_locations_text << index_text << "\n\t{\n"
<< "\t\tMAP_GROUP(" << map_id << "),\n"
<< "\t\tMAP_NUM(" << map_id << "),\n"
<< "\t\t" << json_to_string(heal_location, "x") << ",\n"
<< "\t\t" << json_to_string(heal_location, "y") << ",\n"
<< "\t\t.mapGroup = MAP_GROUP(" << map_id << "),\n"
<< "\t\t.mapNum = MAP_NUM(" << map_id << "),\n"
<< "\t\t.x = " << json_to_string(heal_location, "x") << ",\n"
<< "\t\t.y = " << json_to_string(heal_location, "y") << ",\n"
<< "\t},\n";

// Add element to respawn map array (if field is present)
Expand Down

0 comments on commit 3ace518

Please sign in to comment.