- Fix for fade skins (same seed if 0 by default)
This commit is contained in:
Dawid Bepierszcz
2024-10-20 15:35:20 +02:00
parent 7d4078dc40
commit 686c225f4f
6 changed files with 21 additions and 15 deletions

View File

@@ -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"]))
{

View File

@@ -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)

View File

@@ -1 +1 @@
3.0a
3.0b

View File

@@ -165,4 +165,6 @@ public partial class WeaponPaints
internal static IMenuApi? MenuApi;
private static readonly PluginCapability<IMenuApi> MenuCapability = new("menu:nfcore");
private int _fadeSeed;
}

View File

@@ -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);

View File

@@ -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)
{