(Re)spawn players within 'mapgen_limit'
authorparamat <paramat@users.noreply.github.com>
Sun, 4 Jun 2017 21:28:32 +0000 (22:28 +0100)
committerparamat <mat.gregory@virginmedia.com>
Sun, 11 Jun 2017 01:11:08 +0000 (02:11 +0100)
commit842acbfad2b70550c562f6429d02c980912d2273
tree8c17ebc69f973dcbf6bbd641251a9242dc010b83
parenta9f02ab51cd4b92a98d7b6dffe6d2838796ba9cc
(Re)spawn players within 'mapgen_limit'

Previously, findSpawnPos() did not take the 'mapgen_limit' setting into account,
a small limit often resulted in a spawn out in the void.
Use the recently added 'calcMapgenEdges()' to get max spawn range through a new
mapgenParams function 'getSpawnRangeMax()'.

Previously, when a player respawned into a world, 'objectpos_over_limit()' was
used as a check, which was inaccurate.
Use the recently added 'saoPosOverLimit()' to get exact mapgen edges.

Also fix default value of 'm_sao_limit_min'.
src/mapgen.cpp
src/mapgen.h
src/server.cpp
src/serverenvironment.cpp