Skip to content

Commit

Permalink
Merge pull request #334 from daffyyyy/main
Browse files Browse the repository at this point in the history
GiveSkin fix
  • Loading branch information
daffyyyy authored Oct 20, 2024
2 parents 48b9679 + 536cea9 commit db20e2e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion WeaponAction.cs
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,11 @@ private void GivePlayerWeaponSkin(CCSPlayerController player, CBasePlayerWeapon
return;
}

if (!GPlayerWeaponsInfo[player.Slot][player.Team].TryGetValue(weaponDefIndex, out var value) || value.Paint == 0) return;
if (!GPlayerWeaponsInfo.TryGetValue(player.Slot, out var teamInfo) ||
!teamInfo.TryGetValue(player.Team, out var teamWeapons) )
return;
if (!teamWeapons.TryGetValue(weaponDefIndex, out var value))
return;

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]}");
Expand Down

0 comments on commit db20e2e

Please sign in to comment.