GlobalShare fix

This commit is contained in:
daffyyyy
2023-11-30 14:18:57 +01:00
parent be51e4d1e9
commit 2772fb59b9
3 changed files with 14 additions and 8 deletions

View File

@@ -51,6 +51,9 @@ namespace WeaponPaints
NativeAPI.IssueServerCommand("mp_t_default_melee \"\"");
NativeAPI.IssueServerCommand("mp_ct_default_melee \"\"");
NativeAPI.IssueServerCommand("mp_equipment_reset_rounds 0");
if (Config.GlobalShare)
GlobalShareConnect();
});
}

View File

@@ -224,11 +224,18 @@ namespace WeaponPaints
Server.NextFrame(() =>
{
newWeapon.Clip1 = clip1;
newWeapon.ReserveAmmo[0] = reservedAmmo;
if (newWeapon == null) return;
try
{
newWeapon.Clip1 = clip1;
newWeapon.ReserveAmmo[0] = reservedAmmo;
}
catch (Exception)
{ }
});
}
} catch(Exception ex)
}
catch (Exception ex)
{
Console.WriteLine("[WeaponPaints] Refreshing weapons exception");
Console.WriteLine(ex.Message);

View File

@@ -11,7 +11,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
public override string ModuleName => "WeaponPaints";
public override string ModuleDescription => "Skin and knife selector, standalone and web-based";
public override string ModuleAuthor => "Nereziel & daffyy";
public override string ModuleVersion => "1.3a";
public override string ModuleVersion => "1.3b";
public WeaponPaintsConfig Config { get; set; } = new();
internal static WeaponPaintsConfig _config = new WeaponPaintsConfig();
@@ -101,10 +101,6 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
Utility.TestDatabaseConnection();
}
if (Config.GlobalShare)
GlobalShareConnect();
weaponSync = new WeaponSynchronization(DatabaseConnectionString, Config, GlobalShareApi, GlobalShareServerId);
if (hotReload)