Skip to content

Commit

Permalink
Merge pull request #322 from stefanx111/patch-1
Browse files Browse the repository at this point in the history
remove attributes before initializing skins
  • Loading branch information
daffyyyy authored Oct 19, 2024
2 parents 22337b6 + 6ea0336 commit 1805150
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore
- name: Build
Expand All @@ -46,7 +46,7 @@ jobs:
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 7.0.x
dotnet-version: 8.0.x
- name: Restore
run: dotnet restore
- name: Build
Expand Down
3 changes: 3 additions & 0 deletions WeaponAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,9 @@ private void GivePlayerWeaponSkin(CCSPlayerController player, CBasePlayerWeapon
var weaponInfo = value;
//Log($"Apply on {weapon.DesignerName}({weapon.AttributeManager.Item.ItemDefinitionIndex}) paint {gPlayerWeaponPaints[steamId.SteamId64][weapon.AttributeManager.Item.ItemDefinitionIndex]} seed {gPlayerWeaponSeed[steamId.SteamId64][weapon.AttributeManager.Item.ItemDefinitionIndex]} wear {gPlayerWeaponWear[steamId.SteamId64][weapon.AttributeManager.Item.ItemDefinitionIndex]}");

weapon.AttributeManager.Item.AttributeList.Attributes.RemoveAll();
weapon.AttributeManager.Item.NetworkedDynamicAttributes.Attributes.RemoveAll();

weapon.AttributeManager.Item.ItemID = 16384;
weapon.AttributeManager.Item.ItemIDLow = 16384 & 0xFFFFFFFF;
weapon.AttributeManager.Item.ItemIDHigh = weapon.AttributeManager.Item.ItemIDLow >> 32;
Expand Down

0 comments on commit 1805150

Please sign in to comment.