mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
FindSpawnPos: Let mapgens decide what spawn altitude is suitable
To avoid spawn search failing in new specialised mapgens Increase spawn search range to 4000 nodes Add getSpawnLevelAtPoint() functions to EmergeManager, class Mapgen and all mapgens Remove getGroundLevelAtPoint() functions from all mapgens except mgv6 (possibly to be re-added later in the correct form to return actual ground level) Make mgvalleys flag names consistent with other mapgens Remove now unused 'vertical spawn range' setting
This commit is contained in:
parent
38e7122600
commit
4adbd69a37
19 changed files with 122 additions and 77 deletions
|
@ -181,6 +181,13 @@ public:
|
|||
virtual void makeChunk(BlockMakeData *data) {}
|
||||
virtual int getGroundLevelAtPoint(v2s16 p) { return 0; }
|
||||
|
||||
// getSpawnLevelAtPoint() is a function within each mapgen that returns a
|
||||
// suitable y co-ordinate for player spawn ('suitable' usually meaning
|
||||
// within 16 nodes of water_level). If a suitable spawn level cannot be
|
||||
// found at the specified (X, Z) 'MAX_MAP_GENERATION_LIMIT' is returned to
|
||||
// signify this and to cause Server::findSpawnPos() to try another (X, Z).
|
||||
virtual int getSpawnLevelAtPoint(v2s16 p) { return 0; }
|
||||
|
||||
private:
|
||||
DISABLE_CLASS_COPY(Mapgen);
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue