1
0
mirror of https://gitlab.com/echoes91/throwing.git synced 2025-06-30 07:10:22 +02:00

1.0rc2, fixed nil value comparison

This commit is contained in:
echoes91
2015-03-24 12:38:44 +01:00
parent fa887ba13c
commit 96e2d0f799
9 changed files with 96 additions and 54 deletions

View File

@ -56,7 +56,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
}, nil)
self.object:remove()
local toughness = 0.9
if self.breaks < toughness then
if math.random() < toughness then
minetest.add_item(self.lastpos, 'throwing:arrow_dig')
else
minetest.add_item(self.lastpos, 'default:stick')
@ -73,7 +73,7 @@ THROWING_ARROW_ENTITY.on_step = function(self, dtime)
minetest.dig_node(pos)
end
local toughness = 0.65
if self.breaks < toughness then
if math.random() < toughness then
minetest.add_item(self.lastpos, 'default:pick_steel')
else
minetest.add_item(self.lastpos, 'default:stick')