Skip to content

Commit ef661a8

Browse files
authored
Use Cookie.GetInt & Cookie.SetInt
Closes #23
1 parent a0ce040 commit ef661a8

1 file changed

Lines changed: 3 additions & 8 deletions

File tree

addons/sourcemod/scripting/tf-bhop.sp

Lines changed: 3 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -199,11 +199,8 @@ public void OnClientCookiesCached(int client)
199199
{
200200
if (!g_bIsEnabled)
201201
return;
202-
203-
char value[11];
204-
g_hCookieAutoJumpDisabled.Get(client, value, sizeof(value));
205-
206-
StringToIntEx(value, g_bDisabledAutoBhop[client]);
202+
203+
g_bDisabledAutoBhop[client] = g_hCookieAutoJumpDisabled.GetInt(client) != 0;
207204
}
208205

209206
void OnConVarChanged_EnablePlugin(ConVar convar, const char[] oldValue, const char[] newValue)
@@ -234,9 +231,7 @@ Action ConCmd_ToggleAutoBunnyhopping(int client, int args)
234231
{
235232
bool bValue = g_bDisabledAutoBhop[client] = !g_bDisabledAutoBhop[client];
236233

237-
char value[11];
238-
if (IntToString(bValue, value, sizeof(value)))
239-
g_hCookieAutoJumpDisabled.Set(client, value);
234+
g_hCookieAutoJumpDisabled.SetInt(client, bValue);
240235

241236
ReplyToCommand(client, "%t", bValue ? "Auto-bunnyhopping disabled" : "Auto-bunnyhopping enabled");
242237

0 commit comments

Comments
 (0)