continue;
// Calculate relative position in block
- v3s16 relpos = pos - blockpos_last * MAP_BLOCKSIZE;
+ //v3s16 relpos = pos - blockpos_last * MAP_BLOCKSIZE;
// Get node straight from the block
- MapNode n = block->getNode(relpos);
+ //MapNode n = block->getNode(relpos);
u8 oldlight = j->second;
*/
v3s16 toppos = p + v3s16(0,1,0);
- v3s16 bottompos = p + v3s16(0,-1,0);
+ //v3s16 bottompos = p + v3s16(0,-1,0);
bool node_under_sunlight = true;
std::set<v3s16> light_sources;
// Get the brightest neighbour node and propagate light from it
v3s16 n2p = getBrightestNeighbour(bank, p);
try{
- MapNode n2 = getNode(n2p);
+ //MapNode n2 = getNode(n2p);
lightNeighbors(bank, n2p, modified_blocks);
}
catch(InvalidPositionException &e)
}
//relax up
- if (relax && p0.Y <= water_level && liquid_levels[D_TOP] == 0 &&
+ if (relax && ((p0.Y == water_level) || (fast_flood && p0.Y <= water_level)) && liquid_levels[D_TOP] == 0 &&
liquid_levels[D_BOTTOM] == LIQUID_LEVEL_SOURCE &&
total_level >= LIQUID_LEVEL_SOURCE * can_liquid_same_level-
(can_liquid_same_level - relax) &&
total_level = LIQUID_LEVEL_SOURCE * can_liquid_same_level;
}
- // prevent lakes in air under unloaded blocks
- if (p0.Y > water_level && neighbors[D_BOTTOM].n.getContent() == CONTENT_IGNORE) {
- total_level = 0;
+ // prevent lakes in air above unloaded blocks
+ if (liquid_levels[D_TOP] == 0 && (p0.Y > water_level || !fast_flood) && neighbors[D_BOTTOM].n.getContent() == CONTENT_IGNORE) {
+ --total_level;
}
// calculate self level 5 blocks
delete chunk;
}
#endif
+
+ delete m_mgparams;
}
bool ServerMap::initBlockMake(BlockMakeData *data, v3s16 blockpos)
sector = new ServerMapSector(this, p2d, m_gamedef);
// Sector position on map in nodes
- v2s16 nodepos2d = p2d * MAP_BLOCKSIZE;
+ //v2s16 nodepos2d = p2d * MAP_BLOCKSIZE;
/*
Insert to container
break;
params.parseConfigLine(line);
}
-
- MapgenParams *mgparams = m_emerge->getParamsFromSettings(¶ms);
+
+ MapgenParams *mgparams;
+ try {
+ mgparams = m_emerge->getParamsFromSettings(¶ms);
+ } catch (SettingNotFoundException &e) {
+ infostream << "Couldn't get a setting from map_meta.txt: "
+ << e.what() << std::endl;
+ mgparams = NULL;
+ }
+
if (mgparams) {
if (m_mgparams)
delete m_mgparams;