Fixed setting gizmo offset with toolgun not working for physical entities other than ragdolls and props

This commit is contained in:
penolakushari 2024-08-18 18:11:31 +03:00
parent 65885218be
commit 50c61eac64

View File

@ -1809,7 +1809,7 @@ function TOOL:LeftClick()
elseif ent:GetClass() == "prop_ragdoll" then
ent = ent:GetPhysicsObjectNum(RAGDOLLMOVER[pl].PhysBone)
ogpos, ogang = ent:GetPos(), ent:GetAngles()
elseif ent:GetClass() == "prop_physics" then
elseif ent:GetPhysicsObjectCount() == 1 then
ent = ent:GetPhysicsObjectNum(0)
ogpos, ogang = ent:GetPos(), ent:GetAngles()
end
@ -2092,7 +2092,7 @@ function TOOL:RightClick()
elseif rgment:GetClass() == "prop_ragdoll" then
rgment = rgment:GetPhysicsObjectNum(RAGDOLLMOVER[pl].PhysBone)
ogpos, ogang = rgment:GetPos(), rgment:GetAngles()
elseif rgment:GetClass() == "prop_physics" then
elseif rgment:GetPhysicsObjectCount() == 1 then
rgment = rgment:GetPhysicsObjectNum(0)
ogpos, ogang = rgment:GetPos(), rgment:GetAngles()
end