Closed modcrafts closed 5 months ago
tacrp_free_atts
When tacrp_free_atts is 0, the Attachment of the gun can not be synced correctly
0
this is because the function SWEP:NetworkWeapon never works
SWEP:NetworkWeapon
by following the sourcecode of net.ReadEntity()
local wpn = net.ReadEntity()
the wpn will always be Invalid when IsValid(wpn) is false
wpn
IsValid(wpn)
just transfer the entIndex instead of the original WriteEntity and use local wpn = Entity(index) to get the weapon everytime
local wpn = Entity(index)
this code is tested and its works for me
Fix for Attachments didn't sync correctly when
tacrp_free_atts
is 0When
tacrp_free_atts
is0
, the Attachment of the gun can not be synced correctlythis is because the function
SWEP:NetworkWeapon
never worksby following the sourcecode of net.ReadEntity()
local wpn = net.ReadEntity()
the
wpn
will always be Invalid whenIsValid(wpn)
is falseChanges
just transfer the entIndex instead of the original WriteEntity and use
local wpn = Entity(index)
to get the weapon everytimethis code is tested and its works for me