From d09cd894dd8e6cef7acf8e159c21a8089ad887de Mon Sep 17 00:00:00 2001 From: zaCade Date: Wed, 10 Apr 2019 14:15:08 +0200 Subject: [PATCH] entWatch4: Move flWait code slightly, so it happens when usable. --- _entWatch4/scripting/entWatch-core.sp | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/_entWatch4/scripting/entWatch-core.sp b/_entWatch4/scripting/entWatch-core.sp index 5cefe414..f588ad39 100644 --- a/_entWatch4/scripting/entWatch-core.sp +++ b/_entWatch4/scripting/entWatch-core.sp @@ -494,15 +494,6 @@ public Action OnButtonPress(int button, int client) if ((item.bButton && item.iButton == button) && (item.bClient && item.iClient == client)) { - if (HasEntProp(button, Prop_Data, "m_flWait")) - { - if (item.iWaitTill < RoundToCeil(GetEngineTime())) - { - item.iWaitTill = RoundToCeil(GetEngineTime() + GetEntPropFloat(button, Prop_Data, "m_flWait")); - } - else return Plugin_Handled; - } - Action aResult; Call_StartForward(g_hFwd_OnClientItemCanActivate); Call_PushCell(client); @@ -513,6 +504,15 @@ public Action OnButtonPress(int button, int client) { case Plugin_Continue, Plugin_Changed: { + if (HasEntProp(button, Prop_Data, "m_flWait")) + { + if (item.iWaitTill < RoundToCeil(GetEngineTime())) + { + item.iWaitTill = RoundToCeil(GetEngineTime() + GetEntPropFloat(button, Prop_Data, "m_flWait")); + } + else return Plugin_Handled; + } + switch(item.dConfig.iMode) { case MODE_COOLDOWN: