From 231cfd5ae54a9611a07c5cdbe6fd3bed02f19fb5 Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Sat, 17 Sep 2011 16:28:05 +0200 Subject: [PATCH] ClientKill: prevent multiple suicides in same frame --- qcsrc/server/cl_client.qc | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/qcsrc/server/cl_client.qc b/qcsrc/server/cl_client.qc index 74494eed5..432fa7c50 100644 --- a/qcsrc/server/cl_client.qc +++ b/qcsrc/server/cl_client.qc @@ -1343,9 +1343,11 @@ void KillIndicator_Think() } } +float clientkilltime; void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 = spec { float killtime; + float starttime; entity e; if (gameover) @@ -1381,13 +1383,16 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 } else { + starttime = max(time, clientkilltime); + self.killindicator = spawn(); self.killindicator.owner = self; self.killindicator.scale = 0.5; setattachment(self.killindicator, self, ""); setorigin(self.killindicator, '0 0 52'); self.killindicator.think = KillIndicator_Think; - self.killindicator.nextthink = time + (self.lip) * 0.05; + self.killindicator.nextthink = starttime + (self.lip) * 0.05; + clientkilltime = max(clientkilltime, self.killindicator.nextthink + 0.05); self.killindicator.cnt = ceil(killtime); self.killindicator.count = bound(0, ceil(killtime), 10); //sprint(self, strcat("^1You'll be dead in ", ftos(self.killindicator.cnt), " seconds\n")); @@ -1402,7 +1407,8 @@ void ClientKill_TeamChange (float targetteam) // 0 = don't change, -1 = auto, -2 setattachment(e.killindicator, e, ""); setorigin(e.killindicator, '0 0 52'); e.killindicator.think = KillIndicator_Think; - e.killindicator.nextthink = time + (e.lip) * 0.05; + e.killindicator.nextthink = starttime + (e.lip) * 0.05; + clientkilltime = max(clientkilltime, e.killindicator.nextthink + 0.05); e.killindicator.cnt = ceil(killtime); } self.lip = 0; -- 2.39.2