Replace deprecated functions (MT 5.0.0)
parent
a304eddbfc
commit
d5985901fb
6
init.lua
6
init.lua
|
@ -785,13 +785,13 @@ local function create_corridor_section(waypoint, axis, sign, up_or_down, up_or_d
|
||||||
|
|
||||||
-- Mob spawner (at center)
|
-- Mob spawner (at center)
|
||||||
if place_mob_spawners and tsm_railcorridors.nodes.spawner and not no_spawner and
|
if place_mob_spawners and tsm_railcorridors.nodes.spawner and not no_spawner and
|
||||||
webperlin_major:get3d(p) > 0.3 and webperlin_minor:get3d(p) > 0.5 then
|
webperlin_major:get_3d(p) > 0.3 and webperlin_minor:get_3d(p) > 0.5 then
|
||||||
-- Place spawner (if activated in gameconfig),
|
-- Place spawner (if activated in gameconfig),
|
||||||
-- enclose in cobwebs and setup the spawner node.
|
-- enclose in cobwebs and setup the spawner node.
|
||||||
local spawner_placed = SetNodeIfCanBuild(p, {name=tsm_railcorridors.nodes.spawner})
|
local spawner_placed = SetNodeIfCanBuild(p, {name=tsm_railcorridors.nodes.spawner})
|
||||||
if spawner_placed then
|
if spawner_placed then
|
||||||
local size = 1
|
local size = 1
|
||||||
if webperlin_major:get3d(p) > 0.5 then
|
if webperlin_major:get_3d(p) > 0.5 then
|
||||||
size = 2
|
size = 2
|
||||||
end
|
end
|
||||||
if place_cobwebs then
|
if place_cobwebs then
|
||||||
|
@ -814,7 +814,7 @@ local function create_corridor_section(waypoint, axis, sign, up_or_down, up_or_d
|
||||||
if pr:next(1,5) == 1 then
|
if pr:next(1,5) == 1 then
|
||||||
local h = pr:next(0, 2) -- 3 possible cobweb heights
|
local h = pr:next(0, 2) -- 3 possible cobweb heights
|
||||||
local cpos = {x=basepos.x+vek.x, y=basepos.y+h, z=basepos.z+vek.z}
|
local cpos = {x=basepos.x+vek.x, y=basepos.y+h, z=basepos.z+vek.z}
|
||||||
if webperlin_major:get3d(cpos) > 0.05 and webperlin_minor:get3d(cpos) > 0.1 then
|
if webperlin_major:get_3d(cpos) > 0.05 and webperlin_minor:get_3d(cpos) > 0.1 then
|
||||||
if h == 0 then
|
if h == 0 then
|
||||||
-- No check neccessary at height offset 0 since the cobweb is on the floor
|
-- No check neccessary at height offset 0 since the cobweb is on the floor
|
||||||
return TryPlaceCobweb(cpos)
|
return TryPlaceCobweb(cpos)
|
||||||
|
|
Loading…
Reference in New Issue