From: Rudolf Polzer Date: Sat, 17 Sep 2011 14:28:05 +0000 (+0200) Subject: ClientKill: prevent multiple suicides in same frame X-Git-Tag: xonotic-v0.6.0~40^2~135 X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=231cfd5ae54a9611a07c5cdbe6fd3bed02f19fb5;p=xonotic%2Fxonotic-data.pk3dir.git ClientKill: prevent multiple suicides in same frame --- 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;