Generalize mapgen to consider all players
This commit is contained in:
parent
1eea8e439d
commit
10e0cf24fb
11
init.lua
11
init.lua
@ -1603,10 +1603,10 @@ minetest.register_globalstep(function(dtime)
|
||||
end
|
||||
timer = 0
|
||||
if current_perlin.noise and current_options.autogen then
|
||||
local player = minetest.get_player_by_name("singleplayer")
|
||||
if not player then
|
||||
return
|
||||
end
|
||||
local players = minetest.get_connected_players()
|
||||
for p=1, #players do
|
||||
local player = players[p]
|
||||
local player_name = player:get_player_name()
|
||||
local build = function(pos, pos_hash, player_name)
|
||||
if not pos or not pos.x or not pos.y or not pos.z then
|
||||
minetest.log("error", "[perlin_explorer] build(): Invalid pos!")
|
||||
@ -1658,12 +1658,13 @@ minetest.register_globalstep(function(dtime)
|
||||
for c=1, #noisechunks do
|
||||
local npos = noisechunks[c][1]
|
||||
local nhash = noisechunks[c][2]
|
||||
build(npos, nhash, player:get_player_name())
|
||||
build(npos, nhash, player_name)
|
||||
end
|
||||
if #noisechunks > 0 then
|
||||
minetest.log("verbose", "[perlin_explorer] Done building "..#noisechunks.." noisechunk(s)")
|
||||
end
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
minetest.register_on_joinplayer(function(player)
|
||||
|
Loading…
x
Reference in New Issue
Block a user