Fix crash

This commit is contained in:
LoneWolfHT 2021-03-19 08:31:52 -07:00 committed by GitHub
parent 9e844d8d71
commit 1568de3449
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -74,7 +74,7 @@ check_grapple("shooter_hook:grapple_hook")
local old_grapple_step = minetest.registered_entities["shooter_hook:hook"].on_step
minetest.registered_entities["shooter_hook:hook"].on_step = function(self, dtime, ...)
-- User left the game. Life is no longer worth living for this poor hook
if not self.user then
if not self.user or not minetest.get_player_by_name(self.user) then
self.object:remove()
return
end