View Issue Details

IDProjectCategoryView StatusLast Update
0002997FSSCPtablespublic2014-02-01 22:00
ReporterSpoon Assigned ToEchelon9  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.7.1 
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.

Activities

m_m

2014-01-10 14:08

developer   ~0015572

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.

niffiwan

2014-01-19 02:29

developer   ~0015575

Making +Bitmap required seems like a good idea.

Echelon9

2014-01-19 06:54

developer   ~0015576

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

https://github.com/scp-fs2open/fs2open.github.com/blob/master/code/weapon/weapons.cpp#L912-L920

Interestingly, +Bitmap has been an optional item ever since the Weapon trails were established as part of extensible tables in 2005 by WMCoolman

https://svn.icculus.org/fs2open/trunk/fs2_open/code/weapon/weapons.cpp?r1=2268&r2=2283

Echelon9

2014-01-19 07:01

developer   ~0015577

See proposed patch to resolve per discussion: https://github.com/Echelon9/fs2open.github.com/compare/fix-mantis-2997

For unified diff format, use this link: https://github.com/Echelon9/fs2open.github.com/compare/fix-mantis-2997.diff

Echelon9

2014-02-01 22:00

developer   ~0015583

Fix committed to trunk@10378.

Related Changesets

fs2open: trunk r10378

2014-02-01 16:05

Echelon9


Ported: N/A

Details Diff
Fix Mantis 2997: Make +Bitmap a required table item if a weapon trail has been set Affected Issues
0002997
mod - /trunk/fs2_open/code/weapon/weapons.cpp Diff File

Issue History

Date Modified Username Field Change
2014-01-10 01:23 Spoon New Issue
2014-01-10 14:08 m_m Note Added: 0015572
2014-01-19 02:29 niffiwan Note Added: 0015575
2014-01-19 06:54 Echelon9 Note Added: 0015576
2014-01-19 07:00 Echelon9 Assigned To => Echelon9
2014-01-19 07:00 Echelon9 Status new => assigned
2014-01-19 07:01 Echelon9 Note Added: 0015577
2014-01-19 07:01 Echelon9 Status assigned => code review
2014-02-01 22:00 Echelon9 Changeset attached => fs2open trunk r10378
2014-02-01 22:00 Echelon9 Note Added: 0015583
2014-02-01 22:00 Echelon9 Status code review => resolved
2014-02-01 22:00 Echelon9 Resolution open => fixed