mirror of
https://github.com/Winded/RagdollMover.git
synced 2025-03-04 03:13:36 -05:00
Fix to some errors related to trying to switch gizmo mode when already using them and trying to draw attachment bones that don't exist yet
This commit is contained in:
parent
2b186a31a0
commit
82ecfe24fc
@ -1440,6 +1440,8 @@ local SkeletonData = {}
|
||||
local function DrawRecursiveBones(ent, bone, bonenodes)
|
||||
local mainpos = ent:GetBonePosition(bone)
|
||||
mainpos = mainpos:ToScreen()
|
||||
local nodecache = bonenodes[ent]
|
||||
local nodeexist = nodecache and true or false
|
||||
|
||||
for _, boneid in ipairs(ent:GetChildBones(bone)) do
|
||||
SkeletonData[boneid] = bone
|
||||
@ -1450,8 +1452,8 @@ local function DrawRecursiveBones(ent, bone, bonenodes)
|
||||
surface.DrawLine(mainpos.x, mainpos.y, pos.x, pos.y)
|
||||
DrawRecursiveBones(ent, boneid, bonenodes)
|
||||
local color
|
||||
if bonenodes then
|
||||
color = BONETYPE_COLORS[bonenodes[ent][boneid].Type]
|
||||
if nodeexist and nodecache[boneid] then
|
||||
color = BONETYPE_COLORS[nodecache[boneid].Type]
|
||||
else
|
||||
color = COLOR_RGMGREEN
|
||||
end
|
||||
|
@ -127,7 +127,7 @@ numpad.Register("rgmAxisChangeStateRot", function(pl)
|
||||
if not RAGDOLLMOVER[pl] then RAGDOLLMOVER[pl] = {} end
|
||||
if not rgmMode[pl] then rgmMode[pl] = 1 end
|
||||
|
||||
if not pl:GetTool() then return end
|
||||
if not pl:GetTool() or RAGDOLLMOVER[pl].Moving then return end
|
||||
if pl:GetTool().Mode ~= "ragdollmover" or pl:GetActiveWeapon():GetClass() ~= "gmod_tool" then return end
|
||||
if RotKey[pl] == ScaleKey[pl] then
|
||||
rgmMode[pl] = rgmMode[pl] + 1
|
||||
@ -147,7 +147,7 @@ end)
|
||||
numpad.Register("rgmAxisChangeStateScale", function(pl)
|
||||
if not RAGDOLLMOVER[pl] then RAGDOLLMOVER[pl] = {} end
|
||||
|
||||
if not pl:GetTool() then return end
|
||||
if not pl:GetTool() or RAGDOLLMOVER[pl].Moving then return end
|
||||
if pl:GetTool().Mode ~= "ragdollmover" or pl:GetActiveWeapon():GetClass() ~= "gmod_tool" then return end
|
||||
if RotKey[pl] == ScaleKey[pl] then return end
|
||||
RAGDOLLMOVER[pl].Scale = not RAGDOLLMOVER[pl].Scale
|
||||
|
Loading…
Reference in New Issue
Block a user