mirror of
https://github.com/minetest-mods/3d_armor.git
synced 2024-11-26 06:13:45 +01:00
Stop dropped armor disappearing into ground
This stops dropped armor disappearing into ground at times...
This commit is contained in:
parent
6704431499
commit
306f193db6
@ -526,15 +526,7 @@ if ARMOR_DROP == true or ARMOR_DESTROY == true then
|
||||
armor.drop_armor = function(pos, stack)
|
||||
local obj = minetest.add_item(pos, stack)
|
||||
if obj then
|
||||
local x = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
x = -x
|
||||
end
|
||||
local z = math.random(1, 5)
|
||||
if math.random(1,2) == 1 then
|
||||
z = -z
|
||||
end
|
||||
obj:setvelocity({x=1/x, y=obj:getvelocity().y, z=1/z})
|
||||
obj:setvelocity({x=math.random(-1, 1), y=5, z=math.random(-1, 1)})
|
||||
end
|
||||
end
|
||||
minetest.register_on_dieplayer(function(player)
|
||||
|
Loading…
Reference in New Issue
Block a user