Skip to content

Commit 81d8d06

Browse files
committed
Un-cluttering the autorepair conditional by spreading it out a little.
Should hopefully be a bit more readable this way.
1 parent 7547127 commit 81d8d06

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

code/ship/ship.cpp

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8790,9 +8790,19 @@ void ship_auto_repair_frame(int shipnum, float frametime)
87908790
if ( ssp->current_hits < ssp->max_hits ) {
87918791

87928792
// only repair those subsystems which are not destroyed
8793-
if ( (ssp->max_hits <= 0) || ((ssp->current_hits <= 0) && !(((sip->flags2 & SIF2_SUBSYS_REPAIR_WHEN_DISABLED) && !(ssp->flags & SSF_NO_AUTOREPAIR_IF_DISABLED)) || (ssp->flags & SSF_AUTOREPAIR_IF_DISABLED))) )
8793+
if ( ssp->max_hits <= 0 )
87948794
continue;
87958795

8796+
if ( ssp->current_hits <= 0 ) {
8797+
if (sip->flags2 & SIF2_SUBSYS_REPAIR_WHEN_DISABLED) {
8798+
if (ssp->flags & SSF_NO_AUTOREPAIR_IF_DISABLED) {
8799+
continue;
8800+
}
8801+
} else if (!(ssp->flags & SSF_AUTOREPAIR_IF_DISABLED)) {
8802+
continue;
8803+
}
8804+
}
8805+
87968806
// do incremental repair on the subsystem
87978807
// check for overflow of current_hits
87988808
ssp->current_hits += ssp->max_hits * real_repair_rate * frametime;

0 commit comments

Comments
 (0)