Skip to content

Commit d754f7f

Browse files
committed
fix crash when removing form-on-wing
This goal was missed in `ai_remove_goal_sexp_sub`, so add handling for it. Also make the error message clearer in case another goal is missed in the future.
1 parent 2beaa88 commit d754f7f

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

code/ai/aigoals.cpp

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1235,6 +1235,10 @@ int ai_remove_goal_sexp_sub( int sexp, ai_goal* aigp )
12351235
priority = ( CDR( CDR(node) ) >= 0 ) ? atoi( CTEXT( CDR( CDR( node ) ) ) ) : -1;
12361236
goalmode = AI_GOAL_IGNORE_NEW;
12371237
break;
1238+
case OP_AI_FORM_ON_WING:
1239+
priority = 99;
1240+
goalmode = AI_GOAL_FORM_ON_WING;
1241+
break;
12381242
default:
12391243
const ai_mode_lua* luaAIMode = ai_lua_find_mode(op);
12401244
if(luaAIMode != nullptr){
@@ -1251,7 +1255,7 @@ int ai_remove_goal_sexp_sub( int sexp, ai_goal* aigp )
12511255
priority = localnode >= 0 ? atoi( CTEXT(localnode) ) : -1;
12521256
}
12531257
else {
1254-
UNREACHABLE("Invalid SEXP-OP number %d for an AI goal!", op);
1258+
UNREACHABLE("Invalid SEXP-OP %s (number %d) for an AI goal!", Sexp_nodes[node].text, op);
12551259
}
12561260
break;
12571261
};

0 commit comments

Comments
 (0)