Skip to content

Commit

Permalink
Fix crash if set_bone_pos is called on entities
Browse files Browse the repository at this point in the history
  • Loading branch information
appgurueu committed Dec 26, 2021
1 parent 9e50e25 commit 023390e
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion main.lua
Expand Up @@ -57,7 +57,9 @@ minetest.register_on_joinplayer(function(player)
local PlayerRef = getmetatable(player)
set_bone_position = PlayerRef.set_bone_position
function PlayerRef:set_bone_position(bonename, position, rotation)
set_bone_override(self, bonename or "", position or {x = 0, y = 0, z = 0}, rotation or {x = 0, y = 0, z = 0})
if self:is_player() then
set_bone_override(self, bonename or "", position or {x = 0, y = 0, z = 0}, rotation or {x = 0, y = 0, z = 0})
end
return set_bone_position(self, bonename, position, rotation)
end
end
Expand Down

0 comments on commit 023390e

Please sign in to comment.