diff options
-rw-r--r-- | Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut b/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut index c0e69ba5..3546e3b7 100644 --- a/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut +++ b/Northstar.CustomServers/mod/scripts/vscripts/_utility.gnut @@ -2127,8 +2127,13 @@ void function EntityDemigod_TryAdjustDamageInfo( entity ent, var damageInfo ) return int bottomLimit = 5 + // Set it up so that you at least take 1 damage, for hit indicators etc to trigger if ( ent.GetHealth() <= bottomLimit ) - ent.SetHealth( bottomLimit + 1 ) //Set it up so that you at least take 1 damage, for hit indicators etc to trigger + { + // Prevent going over max health to avoid a server crash. + int newHealth = bottomLimit + 1 + ent.SetHealth( ent.GetMaxHealth() < newHealth ? ent.GetMaxHealth() : newHealth ) + } int health = ent.GetHealth() |