Skip to content

Commit 43f8b12

Browse files
committed
better handling of invalid message sources
Another bug discovered by Durandal. The message sender was a variable containing an invalid value, and the game crashed. This handles it more gracefully. Tested and verified.
1 parent 6e56267 commit 43f8b12

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

code/parse/sexp.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13353,7 +13353,8 @@ void sexp_send_one_message( const char *name, const char *who_from, const char *
1335313353
} else if ( !stricmp(who_from, "<none>") ) {
1335413354
source = MESSAGE_SOURCE_NONE;
1335513355
} else {
13356-
Assertion(false, "Curious... all message sources should have been covered");
13356+
Warning(LOCATION, "Invalid message source '%s'. Unable to send message.", who_from);
13357+
return;
1335713358
}
1335813359

1335913360
if ( ship_index == -1 ){

0 commit comments

Comments
 (0)