From: Mario <mario@smbclan.net>
Date: Wed, 1 Mar 2017 12:11:22 +0000 (+1000)
Subject: Make sure personal data doesn't store health at 0 (should fix endless death loop... 
X-Git-Tag: xonotic-v0.8.2~162
X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=2604f91b8504c3e01d3faccb769ad4501096d1b3;p=xonotic%2Fxonotic-data.pk3dir.git

Make sure personal data doesn't store health at 0 (should fix endless death loop if waypoint is spawned while dead)
---

diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc
index d54feeac8..e6dc964fe 100644
--- a/qcsrc/server/cheats.qc
+++ b/qcsrc/server/cheats.qc
@@ -153,7 +153,7 @@ float CheatImpulse(entity this, int imp)
 			this.personal.ammo_plasma = this.ammo_plasma;
 			this.personal.ammo_shells = this.ammo_shells;
 			this.personal.ammo_fuel = this.ammo_fuel;
-			this.personal.health = this.health;
+			this.personal.health = max(1, this.health);
 			this.personal.armorvalue = this.armorvalue;
 			this.personal.weapons = this.weapons;
 			this.personal.items = this.items;