From 7be0990d5bf9126174fb68a1f9bf97790f092404 Mon Sep 17 00:00:00 2001 From: zaCade Date: Mon, 15 Apr 2019 18:15:00 +0200 Subject: [PATCH] entWatch4: Make the internal wait a float instead. Predator minigun became fucked otherwise. --- _entWatch4/scripting/classes/CItem.inc | 11 ++++++----- _entWatch4/scripting/entWatch-core.sp | 4 ++-- 2 files changed, 8 insertions(+), 7 deletions(-) diff --git a/_entWatch4/scripting/classes/CItem.inc b/_entWatch4/scripting/classes/CItem.inc index 4191a159..7c2413e8 100644 --- a/_entWatch4/scripting/classes/CItem.inc +++ b/_entWatch4/scripting/classes/CItem.inc @@ -19,7 +19,8 @@ methodmap CItem < Basic myclass.SetInt("iTimesUsed", 0); myclass.SetInt("iTimeReady", 0); - myclass.SetInt("iWaitTill", 0); + + myclass.SetFloat("flWait", 0.0); return view_as(myclass); } @@ -111,15 +112,15 @@ methodmap CItem < Basic } } - property int iWaitTill + property float flWait { public get() { - return this.GetInt("iWaitTill"); + return this.GetFloat("flWait"); } - public set(int value) + public set(float value) { - this.SetInt("iWaitTill", value); + this.SetFloat("flWait", value); } } diff --git a/_entWatch4/scripting/entWatch-core.sp b/_entWatch4/scripting/entWatch-core.sp index bb517934..63dcff9b 100644 --- a/_entWatch4/scripting/entWatch-core.sp +++ b/_entWatch4/scripting/entWatch-core.sp @@ -536,9 +536,9 @@ public Action OnButtonPress(int button, int client) { if (HasEntProp(button, Prop_Data, "m_flWait")) { - if (item.iWaitTill < RoundToCeil(GetEngineTime())) + if (item.flWait < GetEngineTime()) { - item.iWaitTill = RoundToCeil(GetEngineTime() + GetEntPropFloat(button, Prop_Data, "m_flWait")); + item.flWait = GetEngineTime() + GetEntPropFloat(button, Prop_Data, "m_flWait"); } else return Plugin_Handled; }