From 0f5abe81b160da27bf1ab1507321fe59db0eb04e Mon Sep 17 00:00:00 2001 From: Mircea Kitsune Date: Mon, 16 Jan 2012 22:12:58 +0200 Subject: [PATCH] Add a safety check on the total damages count, requested by divVerent --- qcsrc/client/damage.qc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 788ef3b8a..e1c5c888a 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -9,7 +9,7 @@ void DamageEffect_Think() if(time >= self.cnt || !self.owner || !self.owner.modelindex || !self.owner.drawmask) { // time is up or the player got gibbed / disconnected - self.owner.total_damages -= 1; + self.owner.total_damages = max(0, self.owner.total_damages - 1); remove(self); return; } @@ -17,7 +17,7 @@ void DamageEffect_Think() { // if the player was dead but is now alive, it means he respawned // if so, clear his damage effects, or damages from his dead body will be copied back - self.owner.total_damages -= 1; + self.owner.total_damages = max(0, self.owner.total_damages - 1); remove(self); return; } -- 2.39.2