1
0
Fork 0
mirror of https://github.com/luanti-org/luanti.git synced 2025-08-11 17:51:04 +00:00

Huge overhaul of the entire MapgenParams system

MapgenParams is no longer a polymorphic class, eliminating the need for messy and bug-prone reallocations.
Separation between the common and mapgen-specific parameters is now strongly defined.
Mapgen parameters objects are now properly encapsulated within the proper subsystems.
This commit is contained in:
kwolekr 2014-02-03 22:42:10 -05:00
parent a439343844
commit 5a34f40d80
24 changed files with 402 additions and 619 deletions

View file

@ -348,12 +348,10 @@ Server::Server(
m_clients.setEnv(m_env);
// Run some callbacks after the MG params have been set up but before activation
MapgenParams *mgparams = servermap->getMapgenParams();
m_script->environment_OnMapgenInit(mgparams);
m_script->environment_OnMapgenInit(&m_emerge->params);
// Initialize mapgens
m_emerge->initMapgens(mgparams);
servermap->setMapgenParams(m_emerge->params);
m_emerge->initMapgens();
// Give environment reference to scripting api
m_script->initializeEnvironment(m_env);
@ -4779,7 +4777,7 @@ v3f findSpawnPos(ServerMap &map)
#endif
#if 1
s16 water_level = map.m_mgparams->water_level;
s16 water_level = map.getWaterLevel();
// Try to find a good place a few times
for(s32 i=0; i<1000; i++)