Enable hook detour on cvar with bounds regardless current value
This commit is contained in:
parent
4cea082303
commit
cc9f679a85
|
@ -392,6 +392,12 @@ void CvarManager::SetCvarMin(CvarInfo* info, bool set, float value, int pluginId
|
||||||
|
|
||||||
if (set)
|
if (set)
|
||||||
{
|
{
|
||||||
|
// Detour is disabled on map change.
|
||||||
|
if (m_HookDetour)
|
||||||
|
{
|
||||||
|
m_HookDetour->EnableDetour();
|
||||||
|
}
|
||||||
|
|
||||||
info->bound.minVal = value;
|
info->bound.minVal = value;
|
||||||
|
|
||||||
// Current value is already in the allowed range.
|
// Current value is already in the allowed range.
|
||||||
|
@ -400,12 +406,6 @@ void CvarManager::SetCvarMin(CvarInfo* info, bool set, float value, int pluginId
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detour is disabled on map change.
|
|
||||||
if (m_HookDetour)
|
|
||||||
{
|
|
||||||
m_HookDetour->EnableDetour();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update if needed.
|
// Update if needed.
|
||||||
CVAR_SET_FLOAT(info->var->name, value);
|
CVAR_SET_FLOAT(info->var->name, value);
|
||||||
}
|
}
|
||||||
|
@ -418,6 +418,12 @@ void CvarManager::SetCvarMax(CvarInfo* info, bool set, float value, int pluginId
|
||||||
|
|
||||||
if (set)
|
if (set)
|
||||||
{
|
{
|
||||||
|
// Detour is disabled on map change.
|
||||||
|
if (m_HookDetour)
|
||||||
|
{
|
||||||
|
m_HookDetour->EnableDetour();
|
||||||
|
}
|
||||||
|
|
||||||
info->bound.maxVal = value;
|
info->bound.maxVal = value;
|
||||||
|
|
||||||
// Current value is already in the allowed range.
|
// Current value is already in the allowed range.
|
||||||
|
@ -426,12 +432,6 @@ void CvarManager::SetCvarMax(CvarInfo* info, bool set, float value, int pluginId
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Detour is disabled on map change.
|
|
||||||
if (m_HookDetour)
|
|
||||||
{
|
|
||||||
m_HookDetour->EnableDetour();
|
|
||||||
}
|
|
||||||
|
|
||||||
// Update if needed.
|
// Update if needed.
|
||||||
CVAR_SET_FLOAT(info->var->name, value);
|
CVAR_SET_FLOAT(info->var->name, value);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user