summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRealBadAngel <mk@realbadangel.pl>2013-01-02 02:39:42 +0100
committerRealBadAngel <mk@realbadangel.pl>2013-01-02 02:39:42 +0100
commit67c0d2834da127b35675462db8b0369f8c6c03ad (patch)
treea9fccbbf4926334a2e0d2a062275a2fcc5916439
parent2bb3b42ca0b5324e14c3f1759f268d90c82ef45a (diff)
Fixed a bug tool workshop being able to fill up the cans
-rw-r--r--technic/technic/tool_workshop.lua30
1 files changed, 17 insertions, 13 deletions
diff --git a/technic/technic/tool_workshop.lua b/technic/technic/tool_workshop.lua
index 86130ff..f47469e 100644
--- a/technic/technic/tool_workshop.lua
+++ b/technic/technic/tool_workshop.lua
@@ -63,18 +63,22 @@ minetest.register_abm({
local load_cost=200
local inv = meta:get_inventory()
if inv:is_empty("src")==false then
- srcstack = inv:get_stack("src", 1)
- src_item=srcstack:to_table()
- local load1=tonumber((src_item["wear"]))
- if charge>load_cost then
- if load1>1 then
- if load1-load_step<0 then load_step=load1 load1=1
- else load1=load1-load_step end
- charge=charge-load_cost
- src_item["wear"]=tostring(load1)
- inv:set_stack("src", 1, src_item)
- end
- end
+ srcstack = inv:get_stack("src", 1)
+ src_item=srcstack:to_table()
+ if (src_item["name"]=="technic:water_can" or src_item["name"]=="technic:lava_can") then
+ load_step=0
+ load_cost=0
+ end
+ local load1=tonumber((src_item["wear"]))
+ if charge>load_cost then
+ if load1>1 then
+ if load1-load_step<0 then load_step=load1 load1=1
+ else load1=load1-load_step end
+ charge=charge-load_cost
+ src_item["wear"]=tostring(load1)
+ inv:set_stack("src", 1, src_item)
+ end
+ end
end
meta:set_float("internal_EU_buffer",charge)
@@ -90,4 +94,4 @@ minetest.register_abm({
"label[1,3;Power level]"..
"list[current_player;main;0,5;8,4;]")
end
-}) \ No newline at end of file
+})