prevent punching with bow to prevent circumvention of cooldown

This commit is contained in:
blut 2024-12-20 00:31:24 +01:00
parent 9173e32730
commit ca0f11b586
2 changed files with 5 additions and 3 deletions

View File

@ -243,6 +243,8 @@ core.register_entity('bow2:arrow_entity', {
})
end
-- put bullet in front of object before punching in order to get correct engine knockback
self.object:set_pos(self._old_pos)
pointed_thing.ref:punch(
self.object,
self._tflp,

View File

@ -27,8 +27,7 @@ function bow2.register_bow(name, def)
core.register_tool(def.name, {
description = def.description,
inventory_image = def.inventory_image or 'nextgen_bows_bow_wood.png',
-- on_use = function(itemstack, user, pointed_thing)
-- end,
range = 0,
on_place = bow2.load,
on_secondary_use = bow2.load,
groups = {bow = 1, flammable = 1},
@ -39,6 +38,7 @@ function bow2.register_bow(name, def)
core.register_tool(def.name_charged, {
description = def.description,
inventory_image = def.inventory_image_charged or 'nextgen_bows_bow_wood_charged.png',
range = 0,
on_use = bow2.shoot,
groups = {bow = 1, flammable = 1, not_in_creative_inventory = 1},
})