Source Code Project Mantis - FSSCP
View Issue Details
0001120FSSCPtablespublic2006-10-21 14:532006-10-27 10:55
ReporterWanderer 
Assigned Totaylor 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformOSOS Version
Product Version 
Target VersionFixed in Version3.6.9 
Summary0001120: Reported error line is not the same as the actual error line
DescriptionThis happen with debug builds. On longer table files (like ships.tbl) the reported line where the error is found is different to the actual error line. The difference between the actual line and the reported line of the error increases the further in the table the error occurs. In retail table ulysses gets error of about 2 and around line 8000 the error is greater than 100 making it useless (points to wrong ship entry).
Additional InformationThe error can be easily seen by extracting a retail ships.tbl to a new mod folder and then 'planting' an error to the file at a known line.
TagsNo tags attached.
Attached Files

Notes
(0006978)
Backslash   
2006-10-21 23:50   
Hmm, you say this even happens in retail? Normally, I assumed it was just a result of all the modular tables and ignored the problem. So it happens even without the MediaVPs and any other TBMs?

Gah I wish my laptop could run retail so I could test this while I'm away this weekend...
(0006979)
Wanderer   
2006-10-22 08:10   
I mean it happen on non-edited table files as well...
(0006980)
Goober5000   
2006-10-22 22:25   
It's probably using the commented version while reporting the uncommented one, or vice versa.
(0006988)
Wanderer   
2006-10-23 16:34   
Dunno if relevant but i tested adding six commented lines before the error and the error moved 6 lines forward respectively. Same result when adding empty lines... that is the error moved forward number of lines exactly equal to the number of the added lines.
(0006989)
taylor   
2006-10-23 17:08   
It's actually using both, and needs to just pick one.

The current code:

p = Mission_text_raw;
stoploc = (Mp - Mission_text) + p;

... reports the wrong numbers.

But this:

p = Mission_text;
stoploc = (Mp - Mission_text) + p;

... reports the line numbers correctly.
(0006990)
Goober5000   
2006-10-23 18:43   
Oh, okay, well that's easy. Now we just need to know which error messages to fix. :)
(0007019)
taylor   
2006-10-26 22:16   
Error messages? I thought that the only bug was the line number reporting, which the change I posted should fix. There is just the one function that needs to be updated, then all of the line number reporting error message should do the right thing.

If that's all that there is then I'll go ahead and commit it, but your comment seemed to indicate an additional problem (which I don't see) so I haven't touched it yet. :)
(0007021)
Goober5000   
2006-10-26 23:10   
(Last edited: 2006-10-26 23:14)
Oh... crap. I thought some error messages were reporting it correctly and some weren't. Okay, I'm committing the fix. :p

EDIT: Actually, wait. Your fix makes the line cancel out to simply this:

stoploc = Mp;

The problem is that Mp is traversing the comment-stripped text, but the function needs to report the line in the raw text.

(0007022)
taylor   
2006-10-26 23:30   
It worked fine for me, counting comments and all in the line counts. I was under the impression (from the code, and comments) that Mission_text would have the same line count as Mission_text_raw, just not have the actual comments. The ptr locations are different, which is why the math was off, but I don't think that the line counts are actually different.

I did miss the obvious "stoploc = Mp" thing though.
(0007024)
Goober5000   
2006-10-27 10:53   
(Last edited: 2006-10-27 10:57)
Oh. Well, if the lines are still there, that's fine then. :)

I'll commit that now.


Issue History
2006-10-21 14:53WandererNew Issue
2006-10-21 23:50BackslashNote Added: 0006978
2006-10-22 08:10WandererNote Added: 0006979
2006-10-22 22:25Goober5000Note Added: 0006980
2006-10-23 16:34WandererNote Added: 0006988
2006-10-23 17:08taylorNote Added: 0006989
2006-10-23 18:43Goober5000Note Added: 0006990
2006-10-23 18:44Goober5000Statusnew => assigned
2006-10-23 18:44Goober5000Assigned To => Goober5000
2006-10-26 22:16taylorNote Added: 0007019
2006-10-26 23:10Goober5000Note Added: 0007021
2006-10-26 23:14Goober5000Note Edited: 0007021
2006-10-26 23:30taylorNote Added: 0007022
2006-10-27 10:53Goober5000Note Added: 0007024
2006-10-27 10:55Goober5000Assigned ToGoober5000 => taylor
2006-10-27 10:55Goober5000Statusassigned => resolved
2006-10-27 10:55Goober5000Resolutionopen => fixed
2006-10-27 10:55Goober5000Fixed in Version => 3.6.9
2006-10-27 10:57Goober5000Note Edited: 0007024