From 2772fb59b93229a756f20a44342b8c55044b940a Mon Sep 17 00:00:00 2001 From: daffyyyy Date: Thu, 30 Nov 2023 14:18:57 +0100 Subject: [PATCH] GlobalShare fix --- Events.cs | 3 +++ WeaponAction.cs | 13 ++++++++++--- WeaponPaints.cs | 6 +----- 3 files changed, 14 insertions(+), 8 deletions(-) diff --git a/Events.cs b/Events.cs index 49d73aa8..08911451 100644 --- a/Events.cs +++ b/Events.cs @@ -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(); }); } diff --git a/WeaponAction.cs b/WeaponAction.cs index 4070e78e..ad238e6d 100644 --- a/WeaponAction.cs +++ b/WeaponAction.cs @@ -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); diff --git a/WeaponPaints.cs b/WeaponPaints.cs index de83e1d1..3f6dddce 100644 --- a/WeaponPaints.cs +++ b/WeaponPaints.cs @@ -11,7 +11,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig "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