bug fixes
This commit is contained in:
parent
97bb86afa0
commit
fbe7508a0a
@ -72,11 +72,6 @@ local function on_rightclick(pos, node, clicker)
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
local function after_dig_node(pos, oldnode, oldmetadata, digger)
|
|
||||||
techage.remove_node(pos)
|
|
||||||
CRDN(oldnode).State:after_dig_node(pos, oldnode, oldmetadata, digger)
|
|
||||||
end
|
|
||||||
|
|
||||||
local tiles = {}
|
local tiles = {}
|
||||||
-- '#' will be replaced by the stage number
|
-- '#' will be replaced by the stage number
|
||||||
-- '{power}' will be replaced by the power PNG
|
-- '{power}' will be replaced by the power PNG
|
||||||
@ -160,7 +155,6 @@ local node_name_ta2, node_name_ta3, node_name_ta4 =
|
|||||||
end,
|
end,
|
||||||
|
|
||||||
on_rightclick = on_rightclick,
|
on_rightclick = on_rightclick,
|
||||||
after_dig_node = after_dig_node,
|
|
||||||
node_timer = keep_running,
|
node_timer = keep_running,
|
||||||
on_rotate = screwdriver.disallow,
|
on_rotate = screwdriver.disallow,
|
||||||
|
|
||||||
|
@ -506,15 +506,19 @@ function NodeStates:after_dig_node(pos, oldnode, oldmetadata, digger)
|
|||||||
local mem = tubelib2.get_mem(pos)
|
local mem = tubelib2.get_mem(pos)
|
||||||
local inv = minetest.get_inventory({type="player", name=digger:get_player_name()})
|
local inv = minetest.get_inventory({type="player", name=digger:get_player_name()})
|
||||||
local cnt = math.max(mem.techage_aging or 1, 1)
|
local cnt = math.max(mem.techage_aging or 1, 1)
|
||||||
|
local left_over
|
||||||
if self.aging_level1 then
|
if self.aging_level1 then
|
||||||
local is_defect = cnt > self.aging_level1 and math.random(self.aging_level2 / cnt) == 1
|
local is_defect = cnt > self.aging_level1 and math.random(self.aging_level2 / cnt) == 1
|
||||||
if self.node_name_defect and is_defect then
|
if self.node_name_defect and is_defect then
|
||||||
inv:add_item("main", ItemStack(self.node_name_defect))
|
left_over = inv:add_item("main", ItemStack(self.node_name_defect))
|
||||||
else
|
else
|
||||||
inv:add_item("main", ItemStack(self.node_name_passive))
|
left_over = inv:add_item("main", ItemStack(self.node_name_passive))
|
||||||
end
|
end
|
||||||
else
|
else
|
||||||
inv:add_item("main", ItemStack(self.node_name_passive))
|
left_over = inv:add_item("main", ItemStack(self.node_name_passive))
|
||||||
|
end
|
||||||
|
if left_over and left_over:get_count() > 0 then
|
||||||
|
minetest.add_item(pos, left_over)
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -192,7 +192,7 @@ minetest.register_node("techage:ta3_akku", {
|
|||||||
|
|
||||||
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
after_dig_node = function(pos, oldnode, oldmetadata, digger)
|
||||||
local mem = tubelib2.get_mem(pos)
|
local mem = tubelib2.get_mem(pos)
|
||||||
State:after_dig_node(pos, oldnode, oldmetadata, digger)
|
--State:after_dig_node(pos, oldnode, oldmetadata, digger)
|
||||||
set_capa(pos, oldnode, digger, mem.capa)
|
set_capa(pos, oldnode, digger, mem.capa)
|
||||||
end,
|
end,
|
||||||
|
|
||||||
@ -200,6 +200,7 @@ minetest.register_node("techage:ta3_akku", {
|
|||||||
on_rightclick = on_rightclick,
|
on_rightclick = on_rightclick,
|
||||||
on_timer = node_timer,
|
on_timer = node_timer,
|
||||||
|
|
||||||
|
drop = "",
|
||||||
paramtype2 = "facedir",
|
paramtype2 = "facedir",
|
||||||
groups = {cracky=2, crumbly=2, choppy=2},
|
groups = {cracky=2, crumbly=2, choppy=2},
|
||||||
on_rotate = screwdriver.disallow,
|
on_rotate = screwdriver.disallow,
|
||||||
|
Loading…
Reference in New Issue
Block a user