Skip to content

Commit 8a8d722

Browse files
committed
fix required_string_either bug
`optional_string_either` advances the parser by default, but `required_string_either` does not advance the parser by default. So be sure to advance the parser here. Followup to #7069.
1 parent 9c353e7 commit 8a8d722

3 files changed

Lines changed: 4 additions & 4 deletions

File tree

code/globalincs/alphacolors.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -388,7 +388,7 @@ void parse_everything_else(const char *filename)
388388
Warning(LOCATION, "Team color in '%s' defined with a name of '%s'; this won't be usable due to 'None' being used for a lack of a team color by the engine.\n", filename, temp2);
389389
}
390390

391-
if (required_string_either("$Team Stripe Color:", "$Team Stripe Colour:") >= 0) {
391+
if (required_string_either("$Team Stripe Color:", "$Team Stripe Colour:", true) >= 0) {
392392
int rgb[3];
393393
stuff_int_list(rgb, 3, ParseLookupType::RAW_INTEGER_TYPE);
394394
for (i = 0; i < 3; i++) {
@@ -400,7 +400,7 @@ void parse_everything_else(const char *filename)
400400
temp_color.stripe.b = rgb[2] / 255.0f;
401401
}
402402

403-
if (required_string_either("$Team Base Color:", "$Team Base Colour:") >= 0) {
403+
if (required_string_either("$Team Base Color:", "$Team Base Colour:", true) >= 0) {
404404
int rgb[3];
405405
stuff_int_list(rgb, 3, ParseLookupType::RAW_INTEGER_TYPE);
406406
for (i = 0; i < 3; i++) {

code/hud/hudparse.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ void parse_hud_gauges_tbl(const char *filename)
305305
required_string("+XSTR ID:");
306306
stuff_int(&preset.xstr);
307307

308-
required_string_either("+Color:", "+Colour:");
308+
required_string_either("+Color:", "+Colour:", true);
309309
int rgb[3] = {255, 255, 255};
310310
stuff_int_list(rgb, 3);
311311

code/ship/ship.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5332,7 +5332,7 @@ static void parse_ship_values(ship_info* sip, const bool is_template, const bool
53325332
WarningEx(LOCATION, "%s '%s'\nIFF colour when IFF is \"%s\" invalid!", info_type_name, sip->name, iff_2);
53335333

53345334
// Set the color
5335-
required_string_either("+As Color:", "+As Colour:");
5335+
required_string_either("+As Color:", "+As Colour:", true);
53365336
stuff_int_list(iff_color_data, 3, ParseLookupType::RAW_INTEGER_TYPE);
53375337
sip->ship_iff_info[{iff_data[0],iff_data[1]}] = iff_init_color(iff_color_data[0], iff_color_data[1], iff_color_data[2]);
53385338
}

0 commit comments

Comments
 (0)