Fix OOM crash with admin shield

This commit is contained in:
stujones11 2017-04-14 17:08:08 +01:00
parent 74ef6c5759
commit 64f8b3cd58

@ -31,7 +31,9 @@ armor:register_armor("shields:shield_admin", {
groups = {armor_shield=1000, armor_heal=100, armor_use=0, not_in_creative_inventory=1}, groups = {armor_shield=1000, armor_heal=100, armor_use=0, not_in_creative_inventory=1},
on_punch = function(player, hitter, time_from_last_punch, tool_capabilities) on_punch = function(player, hitter, time_from_last_punch, tool_capabilities)
if type(hitter) == "userdata" then if type(hitter) == "userdata" then
hitter:punch(player, time_from_last_punch, tool_capabilities) if hitter:is_player() then
hitter:set_wielded_item("")
end
play_sound_effect(player, "default_dig_metal") play_sound_effect(player, "default_dig_metal")
end end
return false return false