Skip to content

Commit f1ceabb

Browse files
Sync different heal location array names
1 parent 1045d02 commit f1ceabb

File tree

2 files changed

+7
-14
lines changed

2 files changed

+7
-14
lines changed

src/heal_location.c

+6-6
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ static void SetWhiteoutRespawnHealerNpcAsLastTalked(u32 healLocationIdx);
88

99
// Arrays described here because mapjson will overrwrite the below data file
1010

11-
// sSpawnPoints
11+
// sHealLocations
1212
// This array defines the fly points for unlocked spawns.
1313

1414
// sWhiteoutRespawnHealCenterMapIdxs
@@ -30,8 +30,8 @@ static u32 GetHealLocationIndexFromMapGroupAndNum(u16 mapGroup, u16 mapNum)
3030
{
3131
u32 i;
3232

33-
for (i = 0; i < NELEMS(sSpawnPoints); i++) {
34-
if (sSpawnPoints[i].mapGroup == mapGroup && sSpawnPoints[i].mapNum == mapNum)
33+
for (i = 0; i < ARRAY_COUNT(sHealLocations); i++) {
34+
if (sHealLocations[i].mapGroup == mapGroup && sHealLocations[i].mapNum == mapNum)
3535
{
3636
return i + 1;
3737
}
@@ -46,16 +46,16 @@ static const struct HealLocation * GetHealLocationPointerFromMapGroupAndNum(u16
4646
if (i == HEAL_LOCATION_NONE)
4747
return NULL;
4848

49-
return &sSpawnPoints[i - 1];
49+
return &sHealLocations[i - 1];
5050
}
5151

5252
const struct HealLocation * GetHealLocation(u32 idx)
5353
{
5454
if (idx == HEAL_LOCATION_NONE)
5555
return NULL;
56-
if (idx > NELEMS(sSpawnPoints))
56+
if (idx > ARRAY_COUNT(sHealLocations))
5757
return NULL;
58-
return &sSpawnPoints[idx - 1];
58+
return &sHealLocations[idx - 1];
5959
}
6060

6161
void SetWhiteoutRespawnWarpAndHealerNpc(struct WarpData * warp)

tools/mapjson/mapjson.cpp

+1-8
Original file line numberDiff line numberDiff line change
@@ -420,15 +420,8 @@ void process_heal_locations(const vector<string> &map_filepaths, string output_f
420420
ostringstream text;
421421
text << "//\n// DO NOT MODIFY THIS FILE! It is auto-generated from data/maps/*/map.json\n//\n\n";
422422

423-
string arr_name;
424-
if (version == "firered") {
425-
arr_name = "sSpawnPoints";
426-
} else {
427-
arr_name = "sHealLocations";
428-
}
429-
430423
string arr_body = heal_locations_text.str();
431-
text << "static const struct HealLocation " << arr_name << "[] =\n{\n" << arr_body << "};\n\n";
424+
text << "static const struct HealLocation sHealLocations[] =\n{\n" << arr_body << "};\n\n";
432425

433426
arr_body = respawn_maps_text.str();
434427
if (!arr_body.empty())

0 commit comments

Comments
 (0)