View Issue Details

IDProjectCategoryView StatusLast Update
0002726FSSCPmodelspublic2012-11-15 07:27
ReporterFUBAR-BDHR Assigned ToGoober5000  
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
Product Version3.6.15 
Summary0002726: Table/model checks for number of lods not working properly
DescriptionI noticed several ships with number of lods defined in the table != number in the pof. This is supposed to warn but I was not getting any warnings.

I did some checking and found the following in ship.cpp at line 8708:

[code]
    if ( sip->num_detail_levels < pm->n_detail_levels )
    {
        Warning(LOCATION, "For ship '%s', detail level\nmismatch. Table has %d,\nPOF has %d.", sip->name, sip->num_detail_levels, pm->n_detail_levels );

        for (i=0; i<pm->n_detail_levels; i++ ) {
            sip->detail_distance[i] = 0;
        }
    }
[/code]

Changing that to != did produce:

For ship 'CR Primus', detail level
mismatch. Table has 4,
POF has 1.

Doing some further searching it also appears that at line 8894 there is also the following:

[code]
    if ( sip->num_detail_levels < pm->n_detail_levels ) {
        Warning(LOCATION, "For ship '%s', detail level\nmismatch (POF needs %d)", sip->name, pm->n_detail_levels );

        for (i=0; i<pm->n_detail_levels; i++ ) {
            sip->detail_distance[i] = 0;
        }
    }
[/code]

This check also appears to be incorrect.
Additional InformationFS2_Open trunk r9343.

Code was added by Goob in r4050 and r1770
TagsNo tags attached.

Activities

Goober5000

2012-11-15 01:42

administrator   ~0014039

Last edited: 2012-11-15 01:43

[s]Just to make sure we don't miss the obvious, you're running on a debug build, right? Warnings don't show up in release builds.[/s]

EDIT: Nevermind, I see what you mean.

Goober5000

2012-11-15 06:54

administrator   ~0014040

FFFF... I had a long comment written up here and then Mantis ate it. Suffice it to say that this theoretically shouldn't be a problem but practically it is (due to the code conflating the array sizes for models and ships in various places). I've fixed it in trunk, and also applied the fix to weapons and asteroids.

Fortunately, none of the retail data has mismatched LODs, so the warning won't be displayed there.

Goober5000

2012-11-15 07:27

administrator   ~0014041

Well, retail asteroids do, at any rate. Anyway, fixed in r9346.

Issue History

Date Modified Username Field Change
2012-11-12 22:14 FUBAR-BDHR New Issue
2012-11-12 22:35 FUBAR-BDHR Additional Information Updated
2012-11-15 01:42 Goober5000 Note Added: 0014039
2012-11-15 01:42 Goober5000 Assigned To => Goober5000
2012-11-15 01:42 Goober5000 Status new => feedback
2012-11-15 01:43 Goober5000 Note Edited: 0014039
2012-11-15 06:54 Goober5000 Note Added: 0014040
2012-11-15 07:27 Goober5000 Note Added: 0014041
2012-11-15 07:27 Goober5000 Status feedback => resolved
2012-11-15 07:27 Goober5000 Resolution open => fixed