Skip to content

Commit

Permalink
Merge pull request scp-fs2open#6093 from Goober5000/sexp_error_check_fix
Browse files Browse the repository at this point in the history
fix bad node identification for certain SEXP errors
  • Loading branch information
Goober5000 committed Apr 23, 2024
2 parents f3c6b0f + 735d4ab commit 289d0b6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions code/parse/sexp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3176,12 +3176,16 @@ int check_sexp_syntax(int node, int return_type, int recursive, int *bad_node, s
z = get_operator_const(z);
if (ship_num >= 0) {
if (!query_sexp_ai_goal_valid(z, ship_num)){
if (bad_node)
*bad_node = ship_node;
return SEXP_CHECK_ORDER_NOT_ALLOWED;
}

} else {
for (i=0; i<Wings[wing_num].wave_count; i++){
if (!query_sexp_ai_goal_valid(z, Wings[wing_num].ship_index[i])){
if (bad_node)
*bad_node = ship_node;
return SEXP_CHECK_ORDER_NOT_ALLOWED;
}
}
Expand All @@ -3190,6 +3194,8 @@ int check_sexp_syntax(int node, int return_type, int recursive, int *bad_node, s
if ((z == OP_AI_DOCK) && (Sexp_nodes[node].rest >= 0)) {
ship2 = ship_name_lookup(CTEXT(Sexp_nodes[node].rest), 1); // Goober5000 - include players
if ((ship_num < 0) || !ship_docking_valid(ship_num, ship2)){
if (bad_node)
*bad_node = ship_node;
return SEXP_CHECK_DOCKING_NOT_ALLOWED;
}
}
Expand Down

0 comments on commit 289d0b6

Please sign in to comment.