Fix discharge of flashlight and sonic screwdriver

These two tools wouldn't discharge all the way to zero through use,
unlike most chargeable items.

Incidentally remove a duplicate of the check_for_flashlight() function.
This commit is contained in:
Zefram
2014-04-27 18:40:21 +01:00
committed by ShadowNinja
parent db79675570
commit 5c59d97070
2 changed files with 2 additions and 27 deletions

View File

@ -30,7 +30,7 @@ minetest.register_tool("technic:sonic_screwdriver", {
if not meta1 or not meta1.charge then
return
end
if meta1.charge - 100 > 0 then
if meta1.charge >= 100 then
minetest.sound_play("technic_sonic_screwdriver",
{pos = pos, gain = 0.3, max_hear_distance = 10})
local p = node.param2