View Issue Details

IDProjectCategoryView StatusLast Update
0002164FSSCPtablespublic2010-12-09 19:55
ReporterFSF Assigned ToGenghis  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.12 RC1 
Fixed in Version3.6.13 
Summary0002164: Assert on missing muzzleflash
DescriptionWhen using a muzzleflash effect that is listed in mflash.tbl (or a -mfl.tbm), but the effect is not present in data\effects, FSO gives an assert. Suggest that it gives a normal "Warning: Effect not found: xxx" message.
Additional InformationThe attached .zip will make the Subach produce said error. For use solely with retail data, no MVPs.
TagsNo tags attached.

Activities

2010-03-27 07:54

 

mflash-tables.zip (553 bytes)

2010-03-29 01:04

 

fix_2164.diff (1,156 bytes)   
Index: code/weapon/muzzleflash.cpp
===================================================================
--- code/weapon/muzzleflash.cpp	(revision 6028)
+++ code/weapon/muzzleflash.cpp	(working copy)
@@ -202,10 +202,20 @@
 			continue;
 
 		// blobs
-		for ( idx = 0; idx < Mflash_info[i].blobs.size(); idx++) {
+		int original_num_blobs = Mflash_info[i].blobs.size();
+		int original_idx = 1;
+		for ( idx = 0; idx < Mflash_info[i].blobs.size(); ) {
 			Mflash_info[i].blobs[idx].anim_id = bm_load_animation(Mflash_info[i].blobs[idx].name, &num_frames, &fps, NULL, 1);
-			Assert( Mflash_info[i].blobs[idx].anim_id >= 0 );
-			bm_page_in_xparent_texture( Mflash_info[i].blobs[idx].anim_id );
+			if ( Mflash_info[i].blobs[idx].anim_id >= 0 ) {
+				bm_page_in_xparent_texture( Mflash_info[i].blobs[idx].anim_id );
+				++idx;
+			}
+			else {
+				Warning(LOCATION, "Muzleflash \"%s\", blob [%d/%d]\nMuzzleflash blob \"%s\" not found!  Deleting.", 
+					Mflash_info[i].name, original_idx, original_num_blobs, Mflash_info[i].blobs[idx].name);
+				Mflash_info[i].blobs.erase( Mflash_info[i].blobs.begin() + idx );
+			}
+			++original_idx;
 		}
 	}
 }
fix_2164.diff (1,156 bytes)   

Genghis

2010-03-29 01:06

developer   ~0011841

Candidate fix patch uploaded.

In this patch, for each invalid blob it prints a helpful warning then deletes that blob from the muzzleflash. So with the example in this report, it prints the warning 4 times, once for each invalid blob.

The_E

2010-12-09 19:55

administrator   ~0012517

Fix committed in revision 6816

Issue History

Date Modified Username Field Change
2010-03-27 07:54 FSF New Issue
2010-03-27 07:54 FSF File Added: mflash-tables.zip
2010-03-27 19:59 Genghis Assigned To => Genghis
2010-03-27 19:59 Genghis Status new => acknowledged
2010-03-29 01:04 Genghis File Added: fix_2164.diff
2010-03-29 01:06 Genghis Note Added: 0011841
2010-03-29 01:06 Genghis Status acknowledged => assigned
2010-12-09 19:55 The_E Note Added: 0012517
2010-12-09 19:55 The_E Status assigned => resolved
2010-12-09 19:55 The_E Fixed in Version => 3.6.13
2010-12-09 19:55 The_E Resolution open => fixed