mirror of
https://github.com/Nereziel/cs2-WeaponPaints.git
synced 2026-02-18 02:41:54 +00:00
3.0b
- Fix for fade skins (same seed if 0 by default)
This commit is contained in:
10
Commands.cs
10
Commands.cs
@@ -164,16 +164,8 @@ public partial class WeaponPaints
|
||||
if (!teamWeapons.TryGetValue(weapon.AttributeManager.Item.ItemDefinitionIndex, out var teamWeapon))
|
||||
return;
|
||||
|
||||
if (teamWeapon.StatTrak)
|
||||
{
|
||||
teamWeapon.StatTrak = false;
|
||||
teamWeapon.StatTrak = !teamWeapon.StatTrak;
|
||||
RefreshWeapons(player);
|
||||
}
|
||||
else
|
||||
{
|
||||
teamWeapon.StatTrak = true;
|
||||
RefreshWeapons(player);
|
||||
}
|
||||
|
||||
if (!string.IsNullOrEmpty(Localizer["wp_stattrak_action"]))
|
||||
{
|
||||
|
||||
@@ -121,6 +121,9 @@ namespace WeaponPaints
|
||||
|
||||
if (Database != null)
|
||||
WeaponSync = new WeaponSynchronization(Database, Config);
|
||||
|
||||
_fadeSeed = 0;
|
||||
_nextItemId = MinimumCustomItemId;
|
||||
}
|
||||
|
||||
private HookResult OnPlayerSpawn(EventPlayerSpawn @event, GameEventInfo info)
|
||||
|
||||
@@ -165,4 +165,6 @@ public partial class WeaponPaints
|
||||
|
||||
internal static IMenuApi? MenuApi;
|
||||
private static readonly PluginCapability<IMenuApi> MenuCapability = new("menu:nfcore");
|
||||
|
||||
private int _fadeSeed;
|
||||
}
|
||||
@@ -44,7 +44,7 @@ namespace WeaponPaints
|
||||
UpdatePlayerEconItemId(weapon.AttributeManager.Item);
|
||||
|
||||
int weaponDefIndex = weapon.AttributeManager.Item.ItemDefinitionIndex;
|
||||
int fallbackPaintKit = 0;
|
||||
int fallbackPaintKit;
|
||||
|
||||
weapon.AttributeManager.Item.AccountID = (uint)player.SteamID;
|
||||
|
||||
@@ -98,7 +98,16 @@ namespace WeaponPaints
|
||||
weapon.AttributeManager.Item.ItemIDHigh = weapon.AttributeManager.Item.ItemIDLow >> 32;
|
||||
weapon.AttributeManager.Item.CustomName = weaponInfo.Nametag;
|
||||
weapon.FallbackPaintKit = weaponInfo.Paint;
|
||||
|
||||
if (weaponInfo is { Paint: 38, Seed: 0 })
|
||||
{
|
||||
weapon.FallbackSeed = _fadeSeed++;
|
||||
}
|
||||
else
|
||||
{
|
||||
weapon.FallbackSeed = weaponInfo.Seed;
|
||||
}
|
||||
|
||||
weapon.FallbackWear = weaponInfo.Wear;
|
||||
CAttributeListSetOrAddAttributeValueByName.Invoke(weapon.AttributeManager.Item.NetworkedDynamicAttributes.Handle, "set item texture prefab", weapon.FallbackPaintKit);
|
||||
|
||||
|
||||
@@ -16,7 +16,7 @@ public partial class WeaponPaints : BasePlugin, IPluginConfig<WeaponPaintsConfig
|
||||
public override string ModuleAuthor => "Nereziel & daffyy";
|
||||
public override string ModuleDescription => "Skin, gloves, agents and knife selector, standalone and web-based";
|
||||
public override string ModuleName => "WeaponPaints";
|
||||
public override string ModuleVersion => "3.0a";
|
||||
public override string ModuleVersion => "3.0b";
|
||||
|
||||
public override void Load(bool hotReload)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user