some bugfixes
This commit is contained in:
parent
a7e8da6627
commit
13e8b17f62
@ -41,7 +41,7 @@ local Face2Dir = {[0]=
|
|||||||
local function pos_and_yaw(pos, param2)
|
local function pos_and_yaw(pos, param2)
|
||||||
local dir = Face2Dir[param2]
|
local dir = Face2Dir[param2]
|
||||||
local yaw = minetest.dir_to_yaw(dir)
|
local yaw = minetest.dir_to_yaw(dir)
|
||||||
dir = vector.multiply(dir, 1.3)
|
dir = vector.multiply(dir, 1.1)
|
||||||
pos = vector.add(pos, dir)
|
pos = vector.add(pos, dir)
|
||||||
return pos, {x=0, y=yaw, z=0}
|
return pos, {x=0, y=yaw, z=0}
|
||||||
end
|
end
|
||||||
@ -50,19 +50,18 @@ local function add_rotor(pos, mem, player_name)
|
|||||||
mem.error = false
|
mem.error = false
|
||||||
local pos1 = {x=pos.x-14, y=pos.y-9, z=pos.z-14}
|
local pos1 = {x=pos.x-14, y=pos.y-9, z=pos.z-14}
|
||||||
local pos2 = {x=pos.x+14, y=pos.y+10, z=pos.z+14}
|
local pos2 = {x=pos.x+14, y=pos.y+10, z=pos.z+14}
|
||||||
local num_node = 29*29*20 - 12
|
local num = #minetest.find_nodes_in_area(pos1, pos2, {"techage:ta4_wind_turbine"})
|
||||||
local num = #minetest.find_nodes_in_area(pos1, pos2, {"air", "ignore"})
|
if num > 1 then
|
||||||
if num < num_node then
|
|
||||||
if player_name then
|
if player_name then
|
||||||
minetest.chat_send_player(player_name, S("[TA4 Wind Turbine]")..
|
minetest.chat_send_player(player_name, S("[TA4 Wind Turbine]")..
|
||||||
" "..S("Not enough space!"))
|
" "..S("The wind turbines are too close together!"))
|
||||||
end
|
end
|
||||||
M(pos):set_string("infotext", S("TA4 Wind Turbine").." "..S("Error"))
|
M(pos):set_string("infotext", S("TA4 Wind Turbine").." "..S("Error"))
|
||||||
mem.error = true
|
mem.error = true
|
||||||
return
|
return
|
||||||
end
|
end
|
||||||
|
|
||||||
local data = minetest.get_biome_data({x=pos.x, y=0, z=pos.z})
|
local data = minetest.get_biome_data({x=pos.x, y=-1, z=pos.z})
|
||||||
if not techage.OceanIdTbl[data.biome] then
|
if not techage.OceanIdTbl[data.biome] then
|
||||||
if player_name then
|
if player_name then
|
||||||
minetest.chat_send_player(player_name, S("[TA4 Wind Turbine]")..
|
minetest.chat_send_player(player_name, S("[TA4 Wind Turbine]")..
|
||||||
@ -206,7 +205,6 @@ minetest.register_node("techage:ta4_wind_turbine_nacelle", {
|
|||||||
groups = {cracky=2, crumbly=2, choppy=2},
|
groups = {cracky=2, crumbly=2, choppy=2},
|
||||||
is_ground_content = false,
|
is_ground_content = false,
|
||||||
sounds = default.node_sound_metal_defaults(),
|
sounds = default.node_sound_metal_defaults(),
|
||||||
drop = "",
|
|
||||||
})
|
})
|
||||||
|
|
||||||
minetest.register_entity("techage:rotor_ent", {initial_properties = {
|
minetest.register_entity("techage:rotor_ent", {initial_properties = {
|
||||||
|
Loading…
Reference in New Issue
Block a user