fix weird offsets

This commit is contained in:
Darsu 2025-02-01 01:03:36 +07:00
parent 51a861dc32
commit db0da5e375

View File

@ -123,9 +123,9 @@ function SWEP:GetAttachmentPos(slottbl, wm, idle, nomodeloffset, custompos, cust
bang = customang or a0 bang = customang or a0
end end
local cust = self:GetCustomize()
local possiblecache = self.AttPosCache[slottbl.Address] -- att pos cache local possiblecache = self.AttPosCache[slottbl.Address] -- att pos cache
if possiblecache then if !cust and possiblecache then
if (possiblecache[4] or 0) > CurTime() then if (possiblecache[4] or 0) > CurTime() then
local qpos, qang = llLocalToWorld(possiblecache[1], possiblecache[2], bpos, bang) local qpos, qang = llLocalToWorld(possiblecache[1], possiblecache[2], bpos, bang)
return qpos, qang, possiblecache[3] return qpos, qang, possiblecache[3]
@ -202,7 +202,7 @@ function SWEP:GetAttachmentPos(slottbl, wm, idle, nomodeloffset, custompos, cust
apos = data.pos or apos apos = data.pos or apos
aang = data.ang or aang aang = data.ang or aang
if slottbl.Address then -- att pos cache if slottbl.Address and !cust then -- att pos cache
local ypos, yang = wwWorldToLocal(apos, aang, bpos, bang) local ypos, yang = wwWorldToLocal(apos, aang, bpos, bang)
self.AttPosCache[slottbl.Address] = {ypos, yang, icon_offset, CurTime() + 5} self.AttPosCache[slottbl.Address] = {ypos, yang, icon_offset, CurTime() + 5}
end end