Effects can now define the rate at which they update. This both adds more control and heavily reduces CPU usage by not having to update several effects every frame.
The default value is defined in sm_chaos_effect_update_interval (def: 0.1).
The update interval can be defined in the return value of the update function:
function ChaosEffect_Update()
{
// Update in `sm_chaos_effect_update_interval` seconds
if (someCondition)
return null
// Update in 0.5 seconds
if (someOtherCondition)
return 0.5
// Update next frame
return -1
}
SourcePawn effects that return void or a float value of 0.0 will use the default value
VScript effects that return null will use the default value
To guarantee execution on the next frame for any effect type, return -1.
Effects can now define the rate at which they update. This both adds more control and heavily reduces CPU usage by not having to update several effects every frame.
The default value is defined in
sm_chaos_effect_update_interval
(def:0.1
). The update interval can be defined in the return value of the update function:void
or afloat
value of0.0
will use the default valuenull
will use the default valueTo guarantee execution on the next frame for any effect type, return
-1
.