ANTICHAT

ANTICHAT (https://forum.antichat.xyz/index.php)
-   Общие вопросы программирования (https://forum.antichat.xyz/forumdisplay.php?f=206)
-   -   Скин ложится на кривую UV сетку (https://forum.antichat.xyz/showthread.php?t=1550309)

Corrygan 05.03.2026 17:23

попытался сделать inventory changer на основе berserker, почему-то текстура скина криво ложится на оружие, так со всеми легаси скинами

как исправить?

C++:





Код:

void
ApplyWeaponSkins
(
C_CSPlayerPawn
*
pLocalPawn
,
CCSPlayerInventory
*
pInventory
,
C_CS2HudModelWeapon
*
pHudModelWeapon
)
{
if
(
!
pLocalPawn
||
(
uintptr_t
)
pLocalPawn

GetActiveWeaponPlayer
(
)
;
if
(
!
pWeapon
||
(
uintptr_t
)
pWeapon

GetGameSceneNode
(
)
;
if
(
!
pWeaponSceneNode
)
return
;
C_AttributeContainer
*
pAttributeContainer
=
&
pWeapon
->
m_AttributeManager
(
)
;
C_EconItemView
*
pWeaponItemView
=
&
pAttributeContainer
->
m_Item
(
)
;
if
(
!
pWeaponItemView
)
return
;
C_EconItemDefinition
*
pWeaponDefinition
=
pWeaponItemView
->
get_static_data
(
)
;
if
(
!
pWeaponDefinition
||
pWeaponDefinition
->
is_knife
(
false
)
)
return
;
const
uint64_t
steamID
=
pInventory
->
GetOwner
(
)
.
m_id
;
const
auto
nLoadoutSlot
=
pWeaponDefinition
->
GetLoadoutSlot
(
)
;
C_EconItemView
*
pInLoadout
=
pInventory
->
GetItemInLoadout
(
pWeapon
->
m_iOriginalTeamNumber
(
)
,
nLoadoutSlot
)
;
if
(
!
pInLoadout
||
pInLoadout
->
m_iItemID
(
)
==
0
)
return
;
const
uint64_t
oldItemID
=
pWeaponItemView
->
m_iItemID
(
)
;
if
(
oldItemID
!=
pInLoadout
->
m_iItemID
(
)
)
{
pWeaponItemView
->
m_iItemID
(
)
=
pInLoadout
->
m_iItemID
(
)
;
pWeaponItemView
->
m_iItemIDHigh
(
)
=
pInLoadout
->
m_iItemIDHigh
(
)
;
pWeaponItemView
->
m_iItemIDLow
(
)
=
pInLoadout
->
m_iItemIDLow
(
)
;
pWeaponItemView
->
m_iAccountID
(
)
=
uint32_t
(
steamID
)
;
pWeaponItemView
->
m_bDisallowSOCm
(
)
=
false
;
pWeaponItemView
->
m_bRestoreCustomMaterialAfterPrecache
(
)
=
true
;
pWeapon
->
UpdateComposite
(
1
)
;
pWeapon
->
UpdateCompositeSec
(
1
)
;
S
::
clear_hud
(
pWeaponItemView
)
;
}
}



Время: 17:53