Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions code/parse/sexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2577,15 +2577,19 @@ int check_sexp_syntax(int node, int return_type, int recursive, int *bad_node, s
if (type2 != SEXP_ATOM_STRING) {
return SEXP_CHECK_TYPE_MISMATCH;
}
if (ship_name_lookup(CTEXT(node), 1) < 0) {
if (Fred_running || !mission_check_ship_yet_to_arrive(CTEXT(node))) {
return SEXP_CHECK_INVALID_SHIP;
}
if (ship_name_lookup(CTEXT(node), 1) >= 0) {
break;
}
if (prop_name_lookup(CTEXT(node)) < 0) {
return SEXP_CHECK_INVALID_PROP;
if (prop_name_lookup(CTEXT(node)) >= 0) {
break;
}
break;

// also check arrival list if we're running the game
if (!Fred_running && mission_check_ship_yet_to_arrive(CTEXT(node))) {
break;
}

return SEXP_CHECK_INVALID_SHIP_PROP;

case OPF_AWACS_SUBSYSTEM:
case OPF_ROTATING_SUBSYSTEM:
Expand Down Expand Up @@ -35290,6 +35294,9 @@ const char *sexp_error_message(int num)
case SEXP_CHECK_INVALID_SHIP_WING:
return "Invalid ship or wing name";

case SEXP_CHECK_INVALID_SHIP_PROP:
return "Invalid ship or prop name";

case SEXP_CHECK_INVALID_SHIP_TYPE:
return "Invalid ship type";

Expand Down
1 change: 1 addition & 0 deletions code/parse/sexp.h
Original file line number Diff line number Diff line change
Expand Up @@ -1199,6 +1199,7 @@ enum sexp_error_check
SEXP_CHECK_INVALID_POINT, // invalid point
SEXP_CHECK_NEGATIVE_NUM, // negative number wasn't allowed
SEXP_CHECK_INVALID_SHIP_WING, // invalid ship/wing
SEXP_CHECK_INVALID_SHIP_PROP, // invalid ship/prop
SEXP_CHECK_INVALID_SHIP_TYPE, // invalid ship type
SEXP_CHECK_UNKNOWN_MESSAGE, // invalid message
SEXP_CHECK_INVALID_PRIORITY, // invalid priority for a message
Expand Down
2 changes: 1 addition & 1 deletion code/prop/prop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -322,7 +322,7 @@ void parse_prop_table(const char* filename)
}

if (!flag_found) {
Warning(LOCATION, "Bogus string in ship flags: %s\n", cur_flag);
Warning(LOCATION, "Bogus string in prop flags: %s\n", cur_flag);
}
}
}
Expand Down