Fix shooter.get_weapon_spec
This commit is contained in:
parent
cfb3818b09
commit
5593df448f
1 changed files with 2 additions and 3 deletions
|
@ -93,9 +93,8 @@ shooter.register_weapon = function(name, def)
|
||||||
itemstack = def.on_use(itemstack, user, pointed_thing)
|
itemstack = def.on_use(itemstack, user, pointed_thing)
|
||||||
end
|
end
|
||||||
if itemstack then
|
if itemstack then
|
||||||
local spec = shooter.get_weapon_spec(nil, name) or
|
local spec = shooter.get_weapon_spec(user, name)
|
||||||
table.copy(def.spec)
|
if spec and shooter.fire_weapon(user, itemstack, spec) then
|
||||||
if shooter.fire_weapon(user, itemstack, spec) then
|
|
||||||
itemstack:add_wear(def.spec.wear)
|
itemstack:add_wear(def.spec.wear)
|
||||||
if itemstack:get_count() == 0 then
|
if itemstack:get_count() == 0 then
|
||||||
itemstack:replace(def.unloaded_item.name)
|
itemstack:replace(def.unloaded_item.name)
|
||||||
|
|
Loading…
Reference in a new issue