accept a cross section count of -1 without a warning

Retail models (111 of them in sparky_fs2.vp) store -1 as their cross
section count, meaning none, which the original loader silently accepted.
Routing the count through pof_read_count made every such model warn on
load.  Read it directly and floor it at zero, as before.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Goober5000andClaude Opus 5.5 committed 2026-10-08 03:02:24 -04:00
1 parent 2f131db53a
commit 4ff6c8c447
1 file changed
+2 -1
+2 -1
View File
@@ -1771,7 +1771,8 @@ modelread_status read_model_file_no_subsys(polymodel * pm, const char* filename,
// read in cross section info
pm->xc = nullptr;
if ( pm->version >= 2014 ) {
pm->num_xc = pof_read_count(fp, filename, "cross sections");
// retail models use -1 to mean there are no cross sections
pm->num_xc = std::max(cfread_int(fp), 0);
if (pm->num_xc > 0) {
pm->xc = make_shared<cross_section[]>(pm->num_xc);
for (i=0; i<pm->num_xc; i++) {