Source Code Project Mantis - FSSCP
View Issue Details
0002997FSSCPtablespublic2014-01-09 20:232014-02-01 17:00
Assigned ToEchelon9 
PlatformOSOS Version
Product Version3.7.1 
Target VersionFixed in Version 
Summary0002997: In game crash on missing weapon trail, should be caught during parsing?
DescriptionI was experiencing crashes and decided to debug, to discover that the crash was caused by a ship firing a weapon, debug threw this message at me:

ASSERTION: "ti->texture.bitmap_id != -1" at trails.cpp:193
 Weapon trail could not be loaded
Int3(): From d:\fso\scp - clean\code\globalincs\windebug.cpp at line 1040

After some puzzling I discovered that the weapon table entry was missing +Bitmap: under $Trail: my mistake but, Shouldn't this be caught during the initial game load (as 99% of other table parsing errors are) and not cause a ingame crash instead?
TagsNo tags attached.
Attached Files

2014-01-10 09:08   
Should +Bitmap be made required? I don't see how you can use a trail without a bitmap so making it required should fix future problems.
2014-01-18 21:29   
Making +Bitmap required seems like a good idea.
2014-01-19 01:54   
Yes, it's pretty clear that +Bitmap should be a required table item if a weapon trail has been set.

The remaining +Trail items can all be set to default values by the engine, but this section of code/weapon/weapons.cpp shows that the Bitmap will be set to NULL (leading to Assertions() later on).

Interestingly, +Bitmap has been an optional item ever since the Weapon trails were established as part of extensible tables in 2005 by WMCoolman
2014-01-19 02:01   
See proposed patch to resolve per discussion:

For unified diff format, use this link:
2014-02-01 17:00   
Fix committed to trunk@10378.

Issue History
2014-01-09 20:23SpoonNew Issue
2014-01-10 09:08m_mNote Added: 0015572
2014-01-18 21:29niffiwanNote Added: 0015575
2014-01-19 01:54Echelon9Note Added: 0015576
2014-01-19 02:00Echelon9Assigned To => Echelon9
2014-01-19 02:00Echelon9Statusnew => assigned
2014-01-19 02:01Echelon9Note Added: 0015577
2014-01-19 02:01Echelon9Statusassigned => code review
2014-02-01 17:00Echelon9Changeset attached => fs2open trunk r10378
2014-02-01 17:00Echelon9Note Added: 0015583
2014-02-01 17:00Echelon9Statuscode review => resolved
2014-02-01 17:00Echelon9Resolutionopen => fixed