1
0
mirror of https://github.com/sys4-fr/server-nalc.git synced 2024-11-05 10:00:26 +01:00

[mesecons/hydroturbine] Make turbines sensitive to river water

- Solves #295
This commit is contained in:
LeMagnesium 2015-10-08 18:12:46 +02:00
parent 04d28d7a6b
commit f34d5a6d2c

View File

@ -59,7 +59,7 @@ nodenames = {"mesecons_hydroturbine:hydro_turbine_off"},
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local waterpos={x=pos.x, y=pos.y+1, z=pos.z}
if minetest.get_node(waterpos).name=="default:water_flowing" then
if minetest.get_node(waterpos).name=="default:water_flowing" or minetest.get_node(waterpos).name == "default:river_water_flowing" then
minetest.add_node(pos, {name="mesecons_hydroturbine:hydro_turbine_on"})
nodeupdate(pos)
mesecon.receptor_on(pos)
@ -73,7 +73,7 @@ nodenames = {"mesecons_hydroturbine:hydro_turbine_on"},
chance = 1,
action = function(pos, node, active_object_count, active_object_count_wider)
local waterpos={x=pos.x, y=pos.y+1, z=pos.z}
if minetest.get_node(waterpos).name~="default:water_flowing" then
if minetest.get_node(waterpos).name~="default:water_flowing" or minetest.get_node(waterpos).name ~= "default:river_water_flowing" then
minetest.add_node(pos, {name="mesecons_hydroturbine:hydro_turbine_off"})
nodeupdate(pos)
mesecon.receptor_off(pos)