hopefully fixed villages not spawning sometimes

This commit is contained in:
kaadmy 2015-10-18 11:11:22 -07:00
parent 7603be64d8
commit 5c1647ffdd
1 changed files with 2 additions and 1 deletions

View File

@ -44,7 +44,8 @@ minetest.register_abm(
minetest.remove_node(pos) minetest.remove_node(pos)
local pr = PseudoRandom(minetest.get_mapgen_params().seed+pos.x+pos.y+pos.z) local pr = PseudoRandom(minetest.get_mapgen_params().seed+pos.x+pos.y+pos.z)
if node.name == "village:grassland_village_mg" then if node.name == "village:grassland_village_mg" then
if pr:next(1, 30) == 1 then print((minetest.get_mapgen_params().seed+pos.x+pos.y+pos.z) % 30)
if ((minetest.get_mapgen_params().seed+pos.x+pos.y+pos.z) % 30) == 1 then
local nearest = village.get_nearest_village(pos) local nearest = village.get_nearest_village(pos)
if nearest.dist > village.min_spawn_dist then if nearest.dist > village.min_spawn_dist then
print("Spawning a (Mapgen)Grassland village at "..dump(pos)) print("Spawning a (Mapgen)Grassland village at "..dump(pos))