Fix skin bugs

This commit is contained in:
2026-10-11 15:43:43 +02:00
parent d5cffea428
commit e923a772cc

View File

@@ -8,7 +8,7 @@ class SkinsManager
{ {
private readonly BasePlugin plugin; private readonly BasePlugin plugin;
private static readonly ulong SpawnedWeaponId = 16384; // Randomly chosen private static readonly ulong SpawnedWeaponId = 16384; // Randomly chosen
private static readonly MemoryFunctionVoid<nint, string, float> CAttributeListSetOrAddAttributeValueByName = new("55 48 89 E5 41 57 41 56 49 89 FE 41 55 41 54 53 48 89 F3 48 83 EC ? F3 0F 11 85"); private static readonly MemoryFunctionVoid<nint, string, float> CAttributeListSetOrAddAttributeValueByName = new(GameData.GetSignature("CAttributeList_SetOrAddAttributeValueByName"));
public SkinsManager(BasePlugin plugin) public SkinsManager(BasePlugin plugin)
{ {
@@ -109,9 +109,9 @@ class SkinsManager
weapon.AcceptInput("SetBodygroup", value: "body,0"); weapon.AcceptInput("SetBodygroup", value: "body,0");
Utilities.SetStateChanged(weapon, "CBaseEntity", "m_nFallbackPaintKit"); Utilities.SetStateChanged(weapon, "CEconEntity", "m_nFallbackPaintKit");
Utilities.SetStateChanged(weapon, "CBaseEntity", "m_nFallbackSeed"); Utilities.SetStateChanged(weapon, "CEconEntity", "m_nFallbackSeed");
Utilities.SetStateChanged(weapon, "CBaseEntity", "m_flFallbackWear"); Utilities.SetStateChanged(weapon, "CEconEntity", "m_flFallbackWear");
} }
public void ApplyButterflyKnifeFade(CBasePlayerWeapon weapon, CCSPlayerController player) public void ApplyButterflyKnifeFade(CBasePlayerWeapon weapon, CCSPlayerController player)
@@ -151,9 +151,9 @@ class SkinsManager
weapon.AcceptInput("SetBodygroup", value: "body,0"); weapon.AcceptInput("SetBodygroup", value: "body,0");
Utilities.SetStateChanged(weapon, "CBaseEntity", "m_nFallbackPaintKit"); Utilities.SetStateChanged(weapon, "CEconEntity", "m_nFallbackPaintKit");
Utilities.SetStateChanged(weapon, "CBaseEntity", "m_nFallbackSeed"); Utilities.SetStateChanged(weapon, "CEconEntity", "m_nFallbackSeed");
Utilities.SetStateChanged(weapon, "CBaseEntity", "m_flFallbackWear"); Utilities.SetStateChanged(weapon, "CEconEntity", "m_flFallbackWear");
} }
public void ApplySportGlovesPandorasBox(CCSPlayerController player) public void ApplySportGlovesPandorasBox(CCSPlayerController player)
@@ -216,7 +216,6 @@ class SkinsManager
var pawn = player.PlayerPawn.Value; var pawn = player.PlayerPawn.Value;
if (pawn != null) if (pawn != null)
{ {
// CS2 requiert généralement le préfixe "characters/" au lieu de "agents/" en interne
pawn.SetModel("agents/models/tm_professional/tm_professional_varf.vmdl"); pawn.SetModel("agents/models/tm_professional/tm_professional_varf.vmdl");
} }
} }