Fix to last registered power tool not being able to charge (affected blue energy...
authorRealBadAngel <mk@realbadangel.pl>
Tue, 19 Feb 2013 22:11:41 +0000 (23:11 +0100)
committerRealBadAngel <mk@realbadangel.pl>
Tue, 19 Feb 2013 22:11:41 +0000 (23:11 +0100)
technic/battery_box.lua
technic/battery_box_mv.lua

index 3f612213ff319bb0a3f7e5513c1dfdfc647c7980..d36bca10ecd943c7e35aa4b5e3d7b76775ed06d4 100644 (file)
@@ -194,7 +194,7 @@ minetest.register_abm({
                if src_item["metadata"]=="" then src_item["metadata"]="0" end --create meta for not used before tool/item
 
        local item_max_charge = nil
-       local counter=registered_power_tools_count-1
+       local counter=registered_power_tools_count
        for i=1, counter,1 do
                if power_tools[i].tool_name==src_item["name"] then
                item_max_charge=power_tools[i].max_charge       
index ab51e94fcee0b644f338f483db34f7f0b8550a4f..b8f4e5e961018a631b47262afe5dc1f25450c1ef 100644 (file)
@@ -131,7 +131,7 @@ minetest.register_abm({
                if src_item["metadata"]=="" then src_item["metadata"]="0" end --create meta for not used before tool/item
 
        local item_max_charge = nil
-       local counter=registered_power_tools_count-1
+       local counter=registered_power_tools_count
        for i=1, counter,1 do
                if power_tools[i].tool_name==src_item["name"] then
                item_max_charge=power_tools[i].max_charge