Skip to content

Commit

Permalink
check for "is_player()" on "on_use"
Browse files Browse the repository at this point in the history
  • Loading branch information
BuckarooBanzay committed Oct 5, 2020
1 parent a814fbe commit d6af743
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion init.lua
Original file line number Diff line number Diff line change
Expand Up @@ -328,7 +328,8 @@ minetest.register_tool("hangglider:hangglider", {
inventory_image = "glider_item.png",
stack_max=1,
on_use = function(itemstack, player)
if not player then
if not player or (player.is_player and not player:is_player()) then
-- player does not exist or is created from an autometed machine (fake_player)
return
end
local pos = player:get_pos()
Expand Down

0 comments on commit d6af743

Please sign in to comment.