Source Code Project Mantis - FSSCP
View Issue Details
0002178FSSCPgameplaypublic2010-04-09 15:042010-04-18 23:48
Assigned Toiss_mneur 
PlatformOSOS Version
Product Version3.6.12 RC1 
Target VersionFixed in Version3.6.12 
Summary0002178: Assert in missiontraining.cpp, line 924 for empty training messages
DescriptionTo work around the "only one sound may be played via play-sound-from-file" rule, General Battuta used empty training messages.

However, these cause asserts on debug builds, which I believe are caused by a faulty check.

The assertion reads:
"Assert(Training_num_lines > 0);"
Training_num_lines is determined by running the message that is to be sent through split_str, which may return 0 on empty messages (that is, messages consisting entirely of whitespace).
Changing the check to Assert(Training_num_lines >= 0) fixes this.
TagsNo tags attached.
Attached Filespatch 2178_patch.patch (1,576) 2010-04-18 13:33

2010-04-18 13:43   
Attached a fix. It moves the Assert to the location that the split_str is actually called. Also, moves the number of lines guard to before the number of lines is used for anything.
2010-04-18 23:48   
Patch added in revision 6062.

Issue History
2010-04-09 15:04The_ENew Issue
2010-04-18 13:33iss_mneurFile Added: 2178_patch.patch
2010-04-18 13:43iss_mneurNote Added: 0011888
2010-04-18 23:48Goober5000Note Added: 0011891
2010-04-18 23:48Goober5000Assigned To => iss_mneur
2010-04-18 23:48Goober5000Statusnew => resolved
2010-04-18 23:48Goober5000Resolutionopen => fixed
2010-04-18 23:48Goober5000Fixed in Version => 3.6.12