Skip to content

Commit

Permalink
Merge pull request kgns#241 from kgns/fix/updater_optional
Browse files Browse the repository at this point in the history
made updater optional
  • Loading branch information
kgns authored Oct 31, 2021
2 parents e75f912 + e6f348d commit acdee87
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions addons/sourcemod/scripting/weapons.sp
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@
#include <cstrike>
#include <PTaH>
#include <weapons>
#tryinclude <updater>
#undef REQUIRE_PLUGIN
#include <updater>

#pragma semicolon 1
#pragma newdecls required
Expand All @@ -35,9 +36,7 @@
#include "weapons/menus.sp"
#include "weapons/natives.sp"

#if defined _updater_included
#define UPDATE_URL "https://raw.githubusercontent.com/kgns/weapons/master/addons/sourcemod/updatefile.txt"
#endif


//#define DEBUG
Expand Down Expand Up @@ -133,23 +132,20 @@ public void OnPluginStart()
g_iWeaponSeed[i][j] = -1;
}
}
#if defined _updater_included

if (LibraryExists("updater"))
{
Updater_AddPlugin(UPDATE_URL);
}
#endif
}

#if defined _updater_included
public void OnLibraryAdded(const char[] name)
{
if (StrEqual(name, "updater"))
{
Updater_AddPlugin(UPDATE_URL);
}
}
#endif

#if defined DEBUG
public Action Command_SetKnife(int client, int args)
Expand Down

0 comments on commit acdee87

Please sign in to comment.