void MapgenBasic::generateDungeons(s16 max_stone_y)
{
- if (max_stone_y < node_min.Y)
+ if (node_min.Y > max_stone_y || node_min.Y > dungeon_ymax ||
+ node_max.Y < dungeon_ymin)
return;
u16 num_dungeons = std::fmax(std::floor(
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons
- if ((flags & MG_DUNGEONS) && full_node_min.Y >= dungeon_ymin &&
- full_node_max.Y <= dungeon_ymax)
+ if (flags & MG_DUNGEONS)
generateDungeons(stone_surface_max_y);
// Generate the registered decorations
// Generate the registered ores
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
- if ((flags & MG_DUNGEONS) && full_node_min.Y >= dungeon_ymin &&
- full_node_max.Y <= dungeon_ymax)
+ if (flags & MG_DUNGEONS)
generateDungeons(stone_surface_max_y);
// Generate the registered decorations
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons
- if ((flags & MG_DUNGEONS) && full_node_min.Y >= dungeon_ymin &&
- full_node_max.Y <= dungeon_ymax)
+ if (flags & MG_DUNGEONS)
generateDungeons(stone_surface_max_y);
// Generate the registered decorations
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons and desert temples
- if ((flags & MG_DUNGEONS) && full_node_min.Y >= dungeon_ymin &&
- full_node_max.Y <= dungeon_ymax)
+ if (flags & MG_DUNGEONS)
generateDungeons(stone_surface_max_y);
// Generate the registered decorations
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Generate dungeons
- if ((flags & MG_DUNGEONS) && full_node_min.Y >= dungeon_ymin &&
- full_node_max.Y <= dungeon_ymax)
+ if (flags & MG_DUNGEONS)
generateDungeons(stone_surface_max_y);
// Generate the registered decorations
m_emerge->oremgr->placeAllOres(this, blockseed, node_min, node_max);
// Dungeon creation
- if ((flags & MG_DUNGEONS) && full_node_min.Y >= dungeon_ymin &&
- full_node_max.Y <= dungeon_ymax)
+ if (flags & MG_DUNGEONS)
generateDungeons(stone_surface_max_y);
// Generate the registered decorations