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 24, 2024
1 parent a722e8a commit e301b9a
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions include/heal_location.h
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@

struct HealLocation
{
s8 group;
s8 map;
s8 mapGroup;
s8 mapNum;
u16 x;
u16 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 @@ -11,7 +11,7 @@ u32 GetHealLocationIndexByMap(u16 mapGroup, u16 mapNum)

for (i = 0; i < ARRAY_COUNT(sHealLocations); i++)
{
if (sHealLocations[i].group == mapGroup && sHealLocations[i].map == mapNum)
if (sHealLocations[i].mapGroup == mapGroup && sHealLocations[i].mapNum == mapNum)
return i + 1;
}
return 0;
Expand Down
6 changes: 3 additions & 3 deletions src/overworld.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ void sub_8053538(u8 a1)
const struct HealLocation *warp = GetHealLocation(a1);

if (warp)
Overworld_SetWarpDestination(warp->group, warp->map, -1, warp->x, warp->y);
Overworld_SetWarpDestination(warp->mapGroup, warp->mapNum, -1, warp->x, warp->y);
}

void Overworld_SetWarpDestToLastHealLoc(void)
Expand All @@ -490,7 +490,7 @@ void Overworld_SetHealLocationWarp(u8 healLocationId)
const struct HealLocation *healLocation = GetHealLocation(healLocationId);

if (healLocation != NULL)
SetWarpData(&gSaveBlock1.lastHealLocation, healLocation->group, healLocation->map, -1, healLocation->x, healLocation->y);
SetWarpData(&gSaveBlock1.lastHealLocation, healLocation->mapGroup, healLocation->mapNum, -1, healLocation->x, healLocation->y);
}

void sub_80535C4(s16 a1, s16 a2)
Expand Down Expand Up @@ -548,7 +548,7 @@ void sub_80537CC(u8 a1)
{
const struct HealLocation *warp = GetHealLocation(a1);
if (warp)
SetWarpData(&gSaveBlock1.warp1, warp->group, warp->map, -1, warp->x, warp->y);
SetWarpData(&gSaveBlock1.warp1, warp->mapGroup, warp->mapNum, -1, warp->x, warp->y);
}

void gpu_sync_bg_hide()
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 e301b9a

Please sign in to comment.