Skip to content

Commit

Permalink
Merge pull request #14 from punteroo/development
Browse files Browse the repository at this point in the history
Fixed ConVar Declaration for Cookies
  • Loading branch information
punteroo authored Nov 3, 2021
2 parents e46c3f5 + 0fc3692 commit 52f51a2
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 19 deletions.
Binary file modified plugins/tf2item_cosmetics.smx
Binary file not shown.
Binary file modified plugins/tf2item_weapons.smx
Binary file not shown.
17 changes: 8 additions & 9 deletions scripting/tf2item_cosmetics.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "3.1.0"
#define PLUGIN_VERSION "3.1.1"

public Plugin myinfo =
{
Expand Down Expand Up @@ -85,20 +85,19 @@ public void OnPluginStart()
unusualNames = new ArrayList(64);
unusualIds = new ArrayList();

// Run forward to execute ConVar declarations
OnConfigsExecuted();

// Handle late loading
if (bLateLoad) {
OnConfigsExecuted();

// Register Preference Saving Cookie
pPreferences = CV_UseCookies.BoolValue ? RegClientCookie("tf2item_cosmetics_prefs", "Cosmetic override preferences set for this user.", CookieAccess_Private) : INVALID_HANDLE;

for (int i = 1; i < MaxClients; i++) {
if (IsClientInGame(i) && !IsClientSourceTV(i) && !IsFakeClient(i))
OnClientPostAdminCheck(i);
}
} else
// Register Preference Saving Cookie
pPreferences = CV_UseCookies.BoolValue ? RegClientCookie("tf2item_cosmetics_prefs", "Cosmetic override preferences set for this user.", CookieAccess_Private) : INVALID_HANDLE;
}

// Register Preference Saving Cookie
pPreferences = CV_UseCookies.BoolValue ? RegClientCookie("tf2item_cosmetics_prefs", "Cosmetic override preferences set for this user.", CookieAccess_Private) : INVALID_HANDLE;
}

// Hook spawns if the ConVar is on
Expand Down
19 changes: 9 additions & 10 deletions scripting/tf2item_weapons.sp
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
#pragma semicolon 1
#pragma newdecls required

#define PLUGIN_VERSION "3.1.0"
#define PLUGIN_VERSION "3.1.1"

public Plugin myinfo =
{
Expand Down Expand Up @@ -42,7 +42,7 @@ int clipOff;
int ammoOff;

// Global Late Loading Value
bool bLateLoad;
bool bLateLoad = false;

/////////////////////
/////////////////////
Expand Down Expand Up @@ -87,20 +87,19 @@ public void OnPluginStart() {
HookEvent("player_spawn", OnPlayerSpawn);
HookEvent("post_inventory_application", OnPlayerSpawn);

// Run forward to execute ConVar declarations
OnConfigsExecuted();

// Late loading reset
if (bLateLoad) {
OnConfigsExecuted();

// Register Preference Saving Cookie
pPreferences = CV_UseCookies.BoolValue ? RegClientCookie("tf2item_weapons_prefs", "Weapon override preferences set for this user.", CookieAccess_Private) : INVALID_HANDLE;

for (int i = 1; i < MaxClients; i++) {
if (IsClientInGame(i) && !IsClientSourceTV(i) && !IsFakeClient(i))
OnClientPostAdminCheck(i);
}
} else
// Register Preference Saving Cookie
pPreferences = CV_UseCookies.BoolValue ? RegClientCookie("tf2item_weapons_prefs", "Weapon override preferences set for this user.", CookieAccess_Private) : INVALID_HANDLE;
}

// Register Preference Saving Cookie
pPreferences = CV_UseCookies.BoolValue ? RegClientCookie("tf2item_weapons_prefs", "Weapon override preferences set for this user.", CookieAccess_Private) : INVALID_HANDLE;
}

/* public Action CMD_Test(int client, int args) {
Expand Down
5 changes: 5 additions & 0 deletions scripting/tf2items/tf2item_base.inc
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,11 @@
/*
* Change-Log
*
* 3.1.1 - 03/11/21
* General
* - Fixed #13
* - Overlooked ConVar declaration mistake in logic.
*
* 3.1.0 - 02/11/21
* General
* - Implemented search functionality for Unusual effects and War Paints.
Expand Down

0 comments on commit 52f51a2

Please sign in to comment.