Skip to content

Commit c05c87b

Browse files
authored
Fix setBoneMatrix error (#2227)
* Add isBoneWriteable and fix error * Revert
1 parent 3663b27 commit c05c87b

File tree

1 file changed

+1
-2
lines changed

1 file changed

+1
-2
lines changed

lua/starfall/libs_sh/entities.lua

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1254,7 +1254,6 @@ function ents_methods:setBoneMatrix(bone, matrix)
12541254
checkpermission(instance, ent, "entities.setRenderProperty")
12551255

12561256
bone = math.Clamp(math.floor(bone), 0, Ent_GetBoneCount(ent)-1)
1257-
if Ent_GetBoneName(ent, bone) == "__INVALIDBONE__" then SF.Throw("Invalid Bone! "..bone, 2) end
12581257

12591258
local ent_tbl = Ent_GetTable(ent)
12601259
local boneTbl = ent_tbl.SF_BoneMatrix
@@ -1266,7 +1265,7 @@ function ents_methods:setBoneMatrix(bone, matrix)
12661265
ent_tbl.SF_BoneMatrix = boneTbl
12671266
ent:AddCallback("BuildBonePositions", function(ent, bonecount)
12681267
for i=0, bonecount-1 do
1269-
if boneTbl[i] then Ent_SetBoneMatrix(ent, i, boneTbl[i]) end
1268+
if boneTbl[i] and Ent_GetBoneName(ent, i) ~= "__INVALIDBONE__" then Ent_SetBoneMatrix(ent, i, boneTbl[i]) end
12701269
end
12711270
end)
12721271
end

0 commit comments

Comments
 (0)