View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update |
|---|---|---|---|---|---|
| 0002648 | FSSCP | user interface | public | 2012-05-07 17:04 | 2012-05-09 04:05 |
| Reporter | MjnMixael | Assigned To | m_m | ||
| Priority | normal | Severity | crash | Reproducibility | always |
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.6.14 RC5 | ||||
| Summary | 0002648: Loading a Mainhall with Intercom sounds set to Zero causes CTD | ||||
| Description | Essentially, you can't create a mainhall without intercom sounds short of hacking in an empty sound file. However the CTD took a lot of trial and error to track down. I personally would like to be able to set +Num Intercom Sounds: to 0 and have the code skip to the next chunk (misc anims). But another way to fix this is to add a debug warning and not CTD with no message. The log didn't tell me anything either because it ended while loading EFF files. | ||||
| Steps To Reproduce | Copy retail mainhall.tbl. Go to 1024 section of Aquitaine and set +Num Intercom Sounds: to 0. Then commend out the rest of the lines until you reach +Num Misc Animations:.. Then run FSO. | ||||
| Tags | No tags attached. | ||||
| related to | 0002650 | resolved | CommanderDJ | Allow 0 door animations in mainhall.tbl/tbms |
|
|
I can reproduce this crash and found the cause of the problem. I'll see if I can fix it. |
|
|
mainhallmenu.patch (680 bytes)
Index: code/menuui/mainhallmenu.cpp
===================================================================
--- code/menuui/mainhallmenu.cpp (revision 8764)
+++ code/menuui/mainhallmenu.cpp (working copy)
@@ -1425,6 +1425,12 @@
*/
void main_hall_handle_random_intercom_sounds()
{
+ if (Main_hall->num_random_intercom_sounds <= 0)
+ {
+ // If there are no intercom sounds then just skip this section
+ return;
+ }
+
// if we have no timestamp for the next random sound, then set on
if ( (Main_hall_next_intercom_sound_stamp == -1) && (Main_hall_intercom_sound_handle == -1) ) {
Main_hall_next_intercom_sound_stamp = timestamp((int)(((float)rand()/(float)RAND_MAX) *
|
|
|
The patch fixes the CTD (which was caused by an out-of-bounds exception while accessing the main_hall_defines::intercom_delay vector because 0 isn't a valid index for it). |
|
|
Works like a charm. |
|
|
Fix committed to trunk@8765. |
| Date Modified | Username | Field | Change |
|---|---|---|---|
| 2012-05-07 17:04 | MjnMixael | New Issue | |
| 2012-05-07 17:45 | m_m | Note Added: 0013522 | |
| 2012-05-07 17:45 | m_m | Assigned To | => m_m |
| 2012-05-07 17:45 | m_m | Status | new => assigned |
| 2012-05-07 17:49 | m_m | File Added: mainhallmenu.patch | |
| 2012-05-07 17:50 | m_m | Note Added: 0013523 | |
| 2012-05-07 17:51 | m_m | Status | assigned => code review |
| 2012-05-08 01:51 | MjnMixael | Note Added: 0013524 | |
| 2012-05-08 07:27 | niffiwan | Changeset attached | => fs2open trunk r8765 |
| 2012-05-08 07:27 | niffiwan | Note Added: 0013525 | |
| 2012-05-08 07:27 | niffiwan | Status | code review => resolved |
| 2012-05-08 07:27 | niffiwan | Resolution | open => fixed |
| 2012-05-09 04:05 | CommanderDJ | Relationship added | related to 0002650 |