Skip to content
This repository has been archived by the owner on Aug 20, 2020. It is now read-only.

Commit

Permalink
fix bug if detach player whithout set entity.driver=nil
Browse files Browse the repository at this point in the history
  • Loading branch information
Crabman77 committed Feb 19, 2017
1 parent 6ce526a commit cff8ee1
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion mods/mobs/api.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1859,7 +1859,14 @@ minetest.register_entity(name, {
dir = dir or {x = 0, y = 0, z = 0}

-- weapon wear
hitter:set_detach() --MFF (crabman|27/7/2015) anti usebug, immortal if attached
local attach = hitter:get_attach()
if attach and attach:get_luaentity() then
local luaentity = attach:get_luaentity()
if luaentity.driver then
luaentity.driver = nil
end
hitter:set_detach() --MFF (crabman|27/7/2015) anti usebug, immortal if attached
end
local weapon = hitter:get_wielded_item()
local punch_interval = 1.4

Expand Down

0 comments on commit cff8ee1

Please sign in to comment.