Skip to content

Commit b8e5a39

Browse files
author
Goober5000
committed
for backwards compatibility, check both no-collide and no_collide
1 parent 0dc0d67 commit b8e5a39

File tree

2 files changed

+15
-1
lines changed

2 files changed

+15
-1
lines changed

code/mission/missionparse.cpp

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3036,7 +3036,13 @@ int parse_object(mission *pm, int flag, p_object *p_objp)
30363036
parse_string_flag_list(p_objp->flags, Parse_object_flags, num_parse_object_flags, &unparsed);
30373037
if (!unparsed.empty()) {
30383038
for (size_t k = 0; k < unparsed.size(); ++k) {
3039-
WarningEx(LOCATION, "Unknown flag in parse object flags: %s", unparsed[k].c_str());
3039+
// catch typos or deprecations
3040+
if (!stricmp(unparsed[k].c_str(), "no-collide") || !stricmp(unparsed[k].c_str(), "no_collide")) {
3041+
p_objp->flags.set(Mission::Parse_Object_Flags::OF_No_collide);
3042+
}
3043+
else {
3044+
WarningEx(LOCATION, "Unknown flag in parse object flags: %s", unparsed[k].c_str());
3045+
}
30403046
}
30413047
}
30423048
}

code/ship/ship.cpp

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3430,9 +3430,17 @@ int parse_ship_values(ship_info* sip, const bool is_template, const bool first_t
34303430
Warning(LOCATION, "Use of '%s' flag for %s '%s' - this flag is no longer needed.", Ship_flags[idx].name, info_type_name, sip->name);
34313431
else
34323432
sip->flags.set(Ship_flags[idx].def);
3433+
3434+
break;
34333435
}
34343436
}
34353437

3438+
// catch typos or deprecations
3439+
if (!stricmp(ship_strings[i], "no-collide") || !stricmp(ship_strings[i], "no_collide")) {
3440+
flag_found = true;
3441+
sip->flags.set(Ship::Info_Flags::No_collide);
3442+
}
3443+
34363444
if ( !flag_found && (ship_type_index < 0) )
34373445
Warning(LOCATION, "Bogus string in ship flags: %s\n", ship_strings[i]);
34383446
}

0 commit comments

Comments
 (0)