properly handle death due to negative hull repair rate

This commit is contained in:
Baezon committed 2021-06-18 16:50:55 -04:00
1 parent 318fed546f
commit d2c24efeff
1 file changed
+3 -3
+3 -3
View File
@@ -8967,10 +8967,10 @@ static void ship_auto_repair_frame(int shipnum, float frametime)
{
objp->hull_strength += sp->ship_max_hull_strength * sip->hull_repair_rate * frametime;
if(objp->hull_strength > sp->ship_max_hull_strength)
{
if (objp->hull_strength > sp->ship_max_hull_strength)
objp->hull_strength = sp->ship_max_hull_strength;
}
else if (objp->hull_strength < 0)
ship_hit_kill(objp, nullptr, nullptr, 0, 1);
}
// only allow for the auto-repair of subsystems on small ships