From 620b06799140037ad85f4dee44bc16de459a31bb Mon Sep 17 00:00:00 2001 From: Dawid Bepierszcz <41084667+daffyyyy@users.noreply.github.com> Date: Sat, 20 Jan 2024 18:04:50 +0100 Subject: [PATCH] 1.4a - Probably not needed `SkinsVisibilityFix` anymore --- Events.cs | 7 ++++++- VERSION | 2 +- WeaponAction.cs | 16 ++++++++++++++-- WeaponPaints.cs | 4 ++-- WeaponPaints.csproj | 2 +- 5 files changed, 24 insertions(+), 7 deletions(-) diff --git a/Events.cs b/Events.cs index a92bb475..315f4438 100644 --- a/Events.cs +++ b/Events.cs @@ -95,8 +95,10 @@ namespace WeaponPaints if (player == null || !player.IsValid) return HookResult.Continue; + /* if (Config.Additional.SkinVisibilityFix) AddTimer(0.2f, () => RefreshSkins(player)); + */ return HookResult.Continue; } @@ -243,13 +245,16 @@ namespace WeaponPaints if (Config.Additional.KnifeEnabled && !PlayerHasKnife(player)) { g_knifePickupCount[(int)player.Index] = 0; - AddTimer(0.1f, () => GiveKnifeToPlayer(player)); + GiveKnifeToPlayer(player); + //AddTimer(0.1f, () => GiveKnifeToPlayer(player)); } + /* if (Config.Additional.SkinVisibilityFix) { AddTimer(0.3f, () => RefreshSkins(player)); } + */ return HookResult.Continue; } diff --git a/VERSION b/VERSION index 0fc61d4e..2b2bf49a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -1.3i \ No newline at end of file +1.4a \ No newline at end of file diff --git a/WeaponAction.cs b/WeaponAction.cs index a04aa3c8..8203090f 100644 --- a/WeaponAction.cs +++ b/WeaponAction.cs @@ -23,6 +23,11 @@ namespace WeaponPaints if (isKnife) { weapon.AttributeManager.Item.EntityQuality = 3; + if (weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null) + { + var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode); + skeleton.ForceParentToBeNetworked = true; + } } if (_config.Additional.GiveRandomSkin && @@ -38,7 +43,8 @@ namespace WeaponPaints if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null) { var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode); - skeleton.ModelState.MeshGroupMask = 2; + //skeleton.ModelState.MeshGroupMask = 2; + skeleton.ForceParentToBeNetworked = true; } return; } @@ -52,10 +58,12 @@ namespace WeaponPaints weapon.FallbackPaintKit = weaponInfo.Paint; weapon.FallbackSeed = weaponInfo.Seed; weapon.FallbackWear = weaponInfo.Wear; + if (!isKnife && weapon.CBodyComponent != null && weapon.CBodyComponent.SceneNode != null) { var skeleton = GetSkeletonInstance(weapon.CBodyComponent.SceneNode); - skeleton.ModelState.MeshGroupMask = 2; + skeleton.ForceParentToBeNetworked = true; + //skeleton.ModelState.MeshGroupMask = 2; } } @@ -171,6 +179,7 @@ namespace WeaponPaints internal void RefreshSkins(CCSPlayerController? player) { + return; if (!Utility.IsPlayerValid(player) || !player!.PawnIsAlive) return; AddTimer(0.18f, () => NativeAPI.IssueClientCommand((int)player.Index - 1, "slot3")); @@ -234,8 +243,11 @@ namespace WeaponPaints } } } + + /* if (Config.Additional.SkinVisibilityFix) RefreshSkins(player); + */ } } diff --git a/WeaponPaints.cs b/WeaponPaints.cs index bdf922bf..a4a2fbf5 100644 --- a/WeaponPaints.cs +++ b/WeaponPaints.cs @@ -9,7 +9,7 @@ using System.Collections.Concurrent; namespace WeaponPaints; -[MinimumApiVersion(142)] +[MinimumApiVersion(144)] public partial class WeaponPaints : BasePlugin, IPluginConfig { internal static readonly Dictionary weaponList = new() @@ -145,7 +145,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig "Nereziel & daffyy"; public override string ModuleDescription => "Skin and knife selector, standalone and web-based"; public override string ModuleName => "WeaponPaints"; - public override string ModuleVersion => "1.3i"; + public override string ModuleVersion => "1.4a"; public static WeaponPaintsConfig GetWeaponPaintsConfig() { diff --git a/WeaponPaints.csproj b/WeaponPaints.csproj index 16fb048d..cd2f30dd 100644 --- a/WeaponPaints.csproj +++ b/WeaponPaints.csproj @@ -9,7 +9,7 @@ - +