Move player a bit deeper into the biome in adjust

master
Wuzzy 2019-08-27 16:06:08 +02:00
parent c62e71858e
commit 192582a997
1 changed files with 6 additions and 0 deletions

View File

@ -63,10 +63,16 @@ local function adjust_pos_to_biome_limits(pos, biome_id)
if bpos[ax] < min then
out_of_bounds = true
bpos[ax] = min
if max-min > 16 then
bpos[ax] = math.max(bpos[ax] + 8, -playable_limit)
end
end
if bpos[ax] > max then
out_of_bounds = true
bpos[ax] = max
if max-min > 16 then
bpos[ax] = math.min(bpos[ax] - 8, playable_limit)
end
end
end
return bpos, out_of_bounds