From e7a78fae5b879a35275aedf7bbaee0c380159032 Mon Sep 17 00:00:00 2001 From: Steam Deck User Date: Tue, 7 Mar 2023 17:55:01 -0500 Subject: [PATCH] SERVER: Fix Zap-O-Matic cooldown timer being ignored --- source/server/entities/traps.qc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/source/server/entities/traps.qc b/source/server/entities/traps.qc index 28957ff..fbcadc6 100644 --- a/source/server/entities/traps.qc +++ b/source/server/entities/traps.qc @@ -198,6 +198,8 @@ void zapper_start(string zapper) { entity zents; entity tempe; + float lasting_time = 0; + zents = find(world, zappername, zapper); while (zents) { @@ -207,6 +209,7 @@ void zapper_start(string zapper) { tempe = self; self = zents; self.state = 1; + lasting_time = self.calc_time; A_ElecSwitchOn1(); self = tempe; } else if (zents.classname == "zapper_node" && zents.target) { @@ -218,7 +221,7 @@ void zapper_start(string zapper) { tempe = spawn(); tempe.think = zapper_stop; - tempe.nextthink = time + 2; + tempe.nextthink = time + lasting_time; tempe.zappername = zapper; }