View Issue Details

IDProjectCategoryView StatusLast Update
0002648FSSCPuser interfacepublic2012-05-09 04:05
ReporterMjnMixael Assigned Tom_m  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.14 RC5 
Summary0002648: Loading a Mainhall with Intercom sounds set to Zero causes CTD
DescriptionEssentially, 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 ReproduceCopy 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.
TagsNo tags attached.

Relationships

related to 0002650 resolvedCommanderDJ Allow 0 door animations in mainhall.tbl/tbms 

Activities

m_m

2012-05-07 17:45

developer   ~0013522

I can reproduce this crash and found the cause of the problem. I'll see if I can fix it.

m_m

2012-05-07 17:49

developer  

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) * 
mainhallmenu.patch (680 bytes)   

m_m

2012-05-07 17:50

developer   ~0013523

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).

MjnMixael

2012-05-08 01:51

manager   ~0013524

Works like a charm.

niffiwan

2012-05-08 07:27

developer   ~0013525

Fix committed to trunk@8765.

Related Changesets

fs2open: trunk r8765

2012-05-08 03:28

niffiwan


Ported: N/A

Details Diff
From m!m: Fix for mantis 0002648 - skip intercom mainhall sounds when none are defined Affected Issues
0002648
mod - /trunk/fs2_open/code/menuui/mainhallmenu.cpp Diff File

Issue History

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