Fix corium greifing disabling not working.

This commit is contained in:
RealBadAngel 2015-11-14 11:29:16 +01:00
parent 798a885807
commit 8ef83e8f7e

View File

@ -619,6 +619,10 @@ if damage_enabled then
end end
-- radioactive materials that can result from destroying a reactor -- radioactive materials that can result from destroying a reactor
local corium_griefing = 1
if (not technic.config:get_bool("enable_corium_griefing")) then
corium_griefing = 0
end
for _, state in ipairs({ "flowing", "source" }) do for _, state in ipairs({ "flowing", "source" }) do
minetest.register_node("technic:corium_"..state, { minetest.register_node("technic:corium_"..state, {
@ -652,7 +656,7 @@ for _, state in ipairs({ "flowing", "source" }) do
groups = { groups = {
liquid = 2, liquid = 2,
hot = 3, hot = 3,
igniter = 1, igniter = corium_griefing,
radioactive = (state == "source" and 32000 or 16000), radioactive = (state == "source" and 32000 or 16000),
not_in_creative_inventory = (state == "flowing" and 1 or nil), not_in_creative_inventory = (state == "flowing" and 1 or nil),
}, },
@ -689,28 +693,15 @@ minetest.register_abm({
end, end,
}) })
minetest.register_abm({ if (corium_griefing == 1) then
nodenames = {"technic:corium_flowing"},
neighbors = {"group:water"},
interval = 1,
chance = 1,
action = function (pos, node)
minetest.set_node(pos, {name="technic:chernobylite_block"})
end,
})
local griefing = technic.config:get_bool("enable_corium_griefing")
minetest.register_abm({ minetest.register_abm({
nodenames = {"technic:corium_flowing"}, nodenames = {"technic:corium_flowing"},
interval = 5, interval = 5,
chance = (griefing and 10 or 1), chance = (10 or 1),
action = function (pos, node) action = function (pos, node)
minetest.set_node(pos, {name="technic:chernobylite_block"}) minetest.set_node(pos, {name="technic:chernobylite_block"})
end, end,
}) })
if griefing then
minetest.register_abm({ minetest.register_abm({
nodenames = { "technic:corium_source", "technic:corium_flowing" }, nodenames = { "technic:corium_source", "technic:corium_flowing" },
interval = 4, interval = 4,