mirror of
https://github.com/scp-fs2open/fs2open.github.com.git
synced 2026-11-07 08:15:59 -10:00
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:
1 parent
2f131db53a
commit
4ff6c8c447
1 file changed
+2
-1
@@ -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++) {
|
||||
|
||||
Reference in new issue
Block a user