Skip to content

Commit

Permalink
Merge pull request #115 from daffyyyy/main
Browse files Browse the repository at this point in the history
1.4a
Updated css version
Probably not needed SkinVisibilityFix anymore
  • Loading branch information
Nereziel authored Jan 20, 2024
2 parents 89c425c + 6e5d595 commit f820c7d
Show file tree
Hide file tree
Showing 5 changed files with 24 additions and 7 deletions.
7 changes: 6 additions & 1 deletion Events.cs
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,10 @@ private HookResult OnEventItemPurchasePost(EventItemPurchase @event, GameEventIn

if (player == null || !player.IsValid) return HookResult.Continue;

/*
if (Config.Additional.SkinVisibilityFix)
AddTimer(0.2f, () => RefreshSkins(player));
*/

return HookResult.Continue;
}
Expand Down Expand Up @@ -243,13 +245,16 @@ private HookResult OnPlayerSpawn(EventPlayerSpawn @event, GameEventInfo info)
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;
}
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1.3i
1.4a
16 changes: 14 additions & 2 deletions WeaponAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,11 @@ internal static void ChangeWeaponAttributes(CBasePlayerWeapon? weapon, CCSPlayer
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 &&
Expand All @@ -38,7 +43,8 @@ internal static void ChangeWeaponAttributes(CBasePlayerWeapon? weapon, CCSPlayer
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;
}
Expand All @@ -52,10 +58,12 @@ internal static void ChangeWeaponAttributes(CBasePlayerWeapon? weapon, CCSPlayer
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;
}
}

Expand Down Expand Up @@ -171,6 +179,7 @@ internal void RefreshPlayerKnife(CCSPlayerController? player)

internal void RefreshSkins(CCSPlayerController? player)
{
return;
if (!Utility.IsPlayerValid(player) || !player!.PawnIsAlive) return;

Check warning on line 183 in WeaponAction.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 183 in WeaponAction.cs

View workflow job for this annotation

GitHub Actions / build

Unreachable code detected

Check warning on line 183 in WeaponAction.cs

View workflow job for this annotation

GitHub Actions / publish

Unreachable code detected

Check warning on line 183 in WeaponAction.cs

View workflow job for this annotation

GitHub Actions / publish

Unreachable code detected

AddTimer(0.18f, () => NativeAPI.IssueClientCommand((int)player.Index - 1, "slot3"));
Expand Down Expand Up @@ -234,8 +243,11 @@ internal void RefreshWeapons(CCSPlayerController? player)
}
}
}

/*
if (Config.Additional.SkinVisibilityFix)
RefreshSkins(player);
*/
}
}

Expand Down
4 changes: 2 additions & 2 deletions WeaponPaints.cs
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

namespace WeaponPaints;

[MinimumApiVersion(142)]
[MinimumApiVersion(144)]
public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig>
{
internal static readonly Dictionary<string, string> weaponList = new()
Expand Down Expand Up @@ -145,7 +145,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
public override string ModuleAuthor => "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()
{
Expand Down
2 changes: 1 addition & 1 deletion WeaponPaints.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.147" />
<PackageReference Include="CounterStrikeSharp.API" Version="1.0.148" />
<PackageReference Include="Dapper" Version="2.1.28" />
<PackageReference Include="MySqlConnector" Version="2.3.4" />
<PackageReference Include="Newtonsoft.Json" Version="13.0.3" />
Expand Down

0 comments on commit f820c7d

Please sign in to comment.