Source Code Project Mantis - FSSCP
View Issue Details
0002408FSSCPtablespublic2011-03-05 18:212012-12-17 00:29
Assigned ToGoober5000 
PlatformOSOS Version
Product Version3.6.13 
Target VersionFixed in Version 
Summary0002408: Better error checking for souds.tbl needed
DescriptionI just traced a bug with the wrong sound playing out to a bad table entry in sounds.tbl. Here's the entry:

$Name: 6 Breakup_fighter.ogg, 0, 0,50, 1, 200, 1000 ;; Fighter Death roll

A very easy mistake to make that should be caught during parse but isn't. In case you don't see it it's supposed to be 0.50 not 0,50. So in that case we not only have too many arguments on the line but and invalid value for sound type and a volume of 0 (not sure if that is legal but can't think of a reason it should be).
TagsNo tags attached.
Attached Files? test-snd.tbm (116) 2012-11-19 10:04

2012-11-19 10:05   
(Last edited: 2012-11-19 10:06)
Tested with this sound.tbm. It is indeed not caught be debugger as anything other than a duplicate sound... though looking at the syntax I'm wondering how it could be checked anyway.

And given the new sound entry format available, I'm wondering if it's worth it... given that any new sounds from now on should use the new format anyway.

On 9357.

2012-12-16 18:12   
This is pretty much unfixable within the current parsing code. It's not even possible to write a good error check thingie here.

If you look at parse_gamesnd_old, which is the function that is the culprit here, you will see that it's a rather simple-minded function. Changing it so that it can account for the tabler making a mistake like the one that caused this error is futile, especially given that as mjn said, there are other ways to table sounds now.
2012-12-17 00:24   
It's uncorrectable, true, but it's not impossible to write a simple error detector that will check for extraneous values. I've done so in r9443. (Awkwardly, it required tweaking some parselo functions first.)

Issue History
2011-03-05 18:21FUBAR-BDHRNew Issue
2012-11-19 10:04MjnMixaelFile Added: test-snd.tbm
2012-11-19 10:05MjnMixaelNote Added: 0014072
2012-11-19 10:06MjnMixaelNote Edited: 0014072bug_revision_view_page.php?bugnote_id=14072#r228
2012-11-19 10:06MjnMixaelNote Edited: 0014072bug_revision_view_page.php?bugnote_id=14072#r229
2012-11-19 11:49Goober5000Assigned To => Goober5000
2012-11-19 11:49Goober5000Statusnew => assigned
2012-12-16 18:12The_ENote Added: 0014490
2012-12-16 18:12The_EStatusassigned => closed
2012-12-16 18:12The_EResolutionopen => suspended
2012-12-17 00:24Goober5000Note Added: 0014495
2012-12-17 00:24Goober5000Statusclosed => resolved
2012-12-17 00:24Goober5000Resolutionsuspended => fixed
2012-12-17 00:29Goober5000Changeset attached => fs2open trunk r9443