Skip to content

Commit 87e6a13

Browse files
authored
Merge pull request #4414 from Goober5000/split_subsys_warnings
split subsystem warning display checks
2 parents e27bf0c + bf05cad commit 87e6a13

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

code/model/modelread.cpp

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,8 @@ static int model_initted = 0;
6969
CFILE *ss_fp = NULL; // file pointer used to dump subsystem information
7070
char model_filename[_MAX_PATH]; // temp used to store filename
7171
char debug_name[_MAX_PATH];
72-
int ss_warning_shown = 0; // have we shown the warning dialog concerning the subsystems?
72+
static bool ss_warning_shown_null = false; // have we shown the warning dialog concerning the subsystems?
73+
static bool ss_warning_shown_mismatch = false; // ditto but for a different warning
7374
#endif
7475

7576
static uint Global_checksum = 0;
@@ -882,9 +883,9 @@ void do_new_subsystem( int n_subsystems, model_subsystem *slist, int subobj_num,
882883

883884
if ( slist==NULL ) {
884885
#ifndef NDEBUG
885-
if (!ss_warning_shown) {
886+
if (!ss_warning_shown_null) {
886887
mprintf(("No subsystems found for model \"%s\".\n", model_get(model_num)->filename));
887-
ss_warning_shown = 1;
888+
ss_warning_shown_null = true;
888889
}
889890
#endif
890891
return; // For TestCode, POFView, etc don't bother
@@ -924,12 +925,12 @@ void do_new_subsystem( int n_subsystems, model_subsystem *slist, int subobj_num,
924925
#ifndef NDEBUG
925926
char bname[_MAX_FNAME];
926927

927-
if ( !ss_warning_shown) {
928+
if ( !ss_warning_shown_mismatch) {
928929
_splitpath(model_filename, NULL, NULL, bname, NULL);
929930
// Lets still give a comment about it and not just erase it
930931
Warning(LOCATION,"Not all subsystems in model \"%s\" have a record in ships.tbl.\nThis can cause game to crash.\n\nList of subsystems not found from table is in log file.\n", model_get(model_num)->filename );
931932
mprintf(("Subsystem %s in model %s was not found in ships.tbl!\n", subobj_name, model_get(model_num)->filename));
932-
ss_warning_shown = 1;
933+
ss_warning_shown_mismatch = true;
933934
} else
934935
#endif
935936
mprintf(("Subsystem %s in model %s was not found in ships.tbl!\n", subobj_name, model_get(model_num)->filename));
@@ -1432,7 +1433,8 @@ int read_model_file(polymodel * pm, const char *filename, int n_subsystems, mode
14321433
mprintf(( "Can't open debug file for writing subsystems for %s\n", filename));
14331434
} else {
14341435
strcpy_s(model_filename, filename);
1435-
ss_warning_shown = 0;
1436+
ss_warning_shown_null = false;
1437+
ss_warning_shown_mismatch = false;
14361438
}
14371439
}
14381440
#endif

0 commit comments

Comments
 (0)