fix crash during (artificial) village creation
when using the village tool doing that on an unsuitable location would result in no position for the belltower being available this checks for that and ... doesn't crash then ^^mobs_head_rotation
parent
7379d5bee8
commit
fca259c074
|
@ -237,18 +237,20 @@ function settlements.place_schematics(settlement_info, pr)
|
||||||
|
|
||||||
--attempt to place one belltower in the center of the village - this doesn't always work out great but it's a lot better than doing it first or last.
|
--attempt to place one belltower in the center of the village - this doesn't always work out great but it's a lot better than doing it first or last.
|
||||||
local belltower = table.remove(settlement_info,math.floor(#settlement_info/2))
|
local belltower = table.remove(settlement_info,math.floor(#settlement_info/2))
|
||||||
mcl_structures.place_schematic(
|
if belltower then
|
||||||
vector.offset(belltower["pos"],0,1,0),
|
mcl_structures.place_schematic(
|
||||||
settlements.modpath.."/schematics/belltower.mts",
|
vector.offset(belltower["pos"],0,0,0),
|
||||||
belltower["rotation"],
|
settlements.modpath.."/schematics/belltower.mts",
|
||||||
nil,
|
belltower["rotation"],
|
||||||
true,
|
nil,
|
||||||
nil,
|
true,
|
||||||
function(p1, p2, size, rotation, pr)
|
nil,
|
||||||
spawn_iron_golem(p1)
|
function(p1, p2, size, rotation, pr)
|
||||||
end,
|
spawn_iron_golem(p1)
|
||||||
pr
|
end,
|
||||||
)
|
pr
|
||||||
|
)
|
||||||
|
end
|
||||||
|
|
||||||
for i, built_house in ipairs(settlement_info) do
|
for i, built_house in ipairs(settlement_info) do
|
||||||
local is_last = i == #settlement_info
|
local is_last = i == #settlement_info
|
||||||
|
|
Loading…
Reference in New Issue