Skip to content

Commit f8c41ac

Browse files
committed
improve logging of ship creation and cleanup
It's useful for *all* ship cleanup to be logged, not just big/huge ships. And by extension, it's also useful for ship creation to be logged.
1 parent 2e5a687 commit f8c41ac

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

code/ship/ship.cpp

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8030,7 +8030,8 @@ void ship_cleanup(int shipnum, int cleanup_mode)
80308030
}
80318031
}
80328032

8033-
if (Ship_info[shipp->ship_info_index].is_big_or_huge()) {
8033+
#ifndef NDEBUG
8034+
{
80348035
float mission_time = f2fl(Missiontime);
80358036
int minutes = (int)(mission_time / 60);
80368037
int seconds = (int)mission_time % 60;
@@ -8051,6 +8052,7 @@ void ship_cleanup(int shipnum, int cleanup_mode)
80518052
break;
80528053
}
80538054
}
8055+
#endif
80548056

80558057
// update wingman status gauge
80568058
if ( (shipp->wing_status_wing_index >= 0) && (shipp->wing_status_wing_pos >= 0) ) {
@@ -10153,6 +10155,16 @@ int ship_create(matrix* orient, vec3d* pos, int ship_type, const char* ship_name
1015310155

1015410156
shipp->time_created = Missiontime;
1015510157

10158+
#ifndef NDEBUG
10159+
if (!Fred_running) {
10160+
float mission_time = f2fl(Missiontime);
10161+
int minutes = (int)(mission_time / 60);
10162+
int seconds = (int)mission_time % 60;
10163+
10164+
mprintf(("%s created at %02d:%02d\n", shipp->ship_name, minutes, seconds));
10165+
}
10166+
#endif
10167+
1015610168
return objnum;
1015710169
}
1015810170

0 commit comments

Comments
 (0)