View Issue Details
| ID | Project | Category | View Status | Date Submitted | Last Update | 
|---|---|---|---|---|---|
| 0002164 | FSSCP | tables | public | 2010-03-27 07:54 | 2010-12-09 19:55 | 
| Reporter | FSF | Assigned To | Genghis | ||
| Priority | normal | Severity | minor | Reproducibility | always | 
| Status | resolved | Resolution | fixed | ||
| Product Version | 3.6.12 RC1 | ||||
| Fixed in Version | 3.6.13 | ||||
| Summary | 0002164: Assert on missing muzzleflash | ||||
| Description | When 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 Information | The attached .zip will make the Subach produce said error. For use solely with retail data, no MVPs. | ||||
| Tags | No tags attached. | ||||
| 
		 
 2010-03-27 07:54 
  | 
	|
| 
		 
 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;
 		}
 	}
 }
 | 
| 
		 | 
	
	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.  | 
| 
		 | 
	Fix committed in revision 6816 | 
| 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 |