Add a allow_protected definition parameter

This commit is contained in:
upsilon
2017-03-05 15:30:02 +01:00
parent 33bc0b5f69
commit 4fe2a0c88c
3 changed files with 12 additions and 1 deletions

View File

@ -88,7 +88,7 @@ local function arrow_step(self, dtime)
return
end
if node and minetest.is_protected(pos, self.player) then -- Forbid hitting nodes in protected areas
if node and minetest.is_protected(pos, self.player) and not self.allow_protected then -- Forbid hitting nodes in protected areas
minetest.record_protection_violation(pos, self.player)
logging("hitted a node into a protected area")
return
@ -241,6 +241,7 @@ function throwing.register_arrow(name, def)
on_hit_sound = def.on_hit_sound,
on_throw_sound = def.on_throw_sound,
on_throw = def.on_throw,
allow_protected = def.allow_protected,
target = def.target,
on_hit_fails = def.on_hit_fails,
node = throwing.modname..":"..name,