mirror of
https://notabug.org/TenPlus1/protector.git
synced 2024-12-05 03:33:48 +01:00
add protector_hurt delay to fix drop issue
This commit is contained in:
parent
b6b5460fcd
commit
39cd62a221
6
init.lua
6
init.lua
@ -293,7 +293,11 @@ function minetest.is_protected(pos, digger)
|
||||
|
||||
-- hurt player if protection violated
|
||||
if protector_hurt > 0 and player:get_hp() > 0 then
|
||||
player:set_hp(player:get_hp() - protector_hurt)
|
||||
|
||||
-- This delay fixes item duplication bug (thanks luk3yx)
|
||||
minetest.after(0.1, function()
|
||||
player:set_hp(player:get_hp() - protector_hurt)
|
||||
end)
|
||||
end
|
||||
|
||||
-- flip player when protection violated
|
||||
|
Loading…
Reference in New Issue
Block a user