entWatch4: Make the internal wait a float instead.
Predator minigun became fucked otherwise.
This commit is contained in:
parent
837e40a985
commit
2e13f642c2
@ -19,7 +19,8 @@ methodmap CItem < Basic
|
|||||||
|
|
||||||
myclass.SetInt("iTimesUsed", 0);
|
myclass.SetInt("iTimesUsed", 0);
|
||||||
myclass.SetInt("iTimeReady", 0);
|
myclass.SetInt("iTimeReady", 0);
|
||||||
myclass.SetInt("iWaitTill", 0);
|
|
||||||
|
myclass.SetFloat("flWait", 0.0);
|
||||||
|
|
||||||
return view_as<CItem>(myclass);
|
return view_as<CItem>(myclass);
|
||||||
}
|
}
|
||||||
@ -111,15 +112,15 @@ methodmap CItem < Basic
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
property int iWaitTill
|
property float flWait
|
||||||
{
|
{
|
||||||
public get()
|
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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -536,9 +536,9 @@ public Action OnButtonPress(int button, int client)
|
|||||||
{
|
{
|
||||||
if (HasEntProp(button, Prop_Data, "m_flWait"))
|
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;
|
else return Plugin_Handled;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user