From db0e4bcfe0bcf99d5d21e74e0a1ccc0fc6977a26 Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 6 Apr 2020 14:29:47 +0200 Subject: Weapons have different velocities --- src/ft_time.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'src/ft_time.c') diff --git a/src/ft_time.c b/src/ft_time.c index 88822f5..128d890 100644 --- a/src/ft_time.c +++ b/src/ft_time.c @@ -27,10 +27,14 @@ void { static clock_t dt = 0; clock_t curr; + int8_t weap_id; + weap_id = cl->plist.handles_weapon; + weap_id = (weap_id == 2) ? (1) : (weap_id); + weap_id = (weap_id == 4) ? (2) : (weap_id); curr = clock(); dt += curr - before; - if (dt > 0 && ft_clock_to_ms(dt) > 1000.0) + if (dt > 0 && ft_clock_to_ms(dt) > cl->plist.weap_vel[weap_id]) { cl->plist.fire = 0; dt = 0; -- cgit v1.2.3