Fix inventory corruption when using automatic weapons
This commit is contained in:
parent
5238358ce5
commit
ea8af36b47
1 changed files with 2 additions and 1 deletions
|
@ -421,7 +421,7 @@ local function fire_weapon(player, itemstack, spec, extended)
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
minetest.after(interval, function(...)
|
minetest.after(interval, function(...)
|
||||||
if shooting[spec.user] then
|
if shooting[spec.user] and player:get_wield_index() == spec.wield_idx then
|
||||||
local arg = {...}
|
local arg = {...}
|
||||||
fire_weapon(arg[1], arg[2], arg[3], true)
|
fire_weapon(arg[1], arg[2], arg[3], true)
|
||||||
end
|
end
|
||||||
|
@ -443,6 +443,7 @@ shooter.fire_weapon = function(player, itemstack, spec)
|
||||||
end
|
end
|
||||||
spec.user = name
|
spec.user = name
|
||||||
spec.name = itemstack:get_name()
|
spec.name = itemstack:get_name()
|
||||||
|
spec.wield_idx = player:get_wield_index()
|
||||||
fire_weapon(player, itemstack, spec)
|
fire_weapon(player, itemstack, spec)
|
||||||
return true
|
return true
|
||||||
end
|
end
|
||||||
|
|
Loading…
Reference in a new issue