From d2c24efeffd43385f5eec01d5e06e41dfca28ca1 Mon Sep 17 00:00:00 2001 From: Baezon Date: Fri, 18 Jun 2021 16:50:55 -0400 Subject: [PATCH] properly handle death due to negative hull repair rate --- code/ship/ship.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/code/ship/ship.cpp b/code/ship/ship.cpp index ffbb769c0c..feeff91ec3 100644 --- a/code/ship/ship.cpp +++ b/code/ship/ship.cpp @@ -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