From 5593df448fbb8a74478c54ad2e4e3755ffa51ce9 Mon Sep 17 00:00:00 2001 From: rubenwardy Date: Sat, 14 Mar 2020 20:59:55 +0000 Subject: [PATCH] Fix shooter.get_weapon_spec --- shooter/api.lua | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/shooter/api.lua b/shooter/api.lua index 133fd47..230d136 100644 --- a/shooter/api.lua +++ b/shooter/api.lua @@ -93,9 +93,8 @@ shooter.register_weapon = function(name, def) itemstack = def.on_use(itemstack, user, pointed_thing) end if itemstack then - local spec = shooter.get_weapon_spec(nil, name) or - table.copy(def.spec) - if shooter.fire_weapon(user, itemstack, spec) then + local spec = shooter.get_weapon_spec(user, name) + if spec and shooter.fire_weapon(user, itemstack, spec) then itemstack:add_wear(def.spec.wear) if itemstack:get_count() == 0 then itemstack:replace(def.unloaded_item.name)