-s16 ServerMap::findGroundLevel(v2s16 p2d)
-{
-#if 0
- /*
- Uh, just do something random...
- */
- // Find existing map from top to down
- s16 max=63;
- s16 min=-64;
- v3s16 p(p2d.X, max, p2d.Y);
- for(; p.Y>min; p.Y--)
- {
- MapNode n = getNodeNoEx(p);
- if(n.getContent() != CONTENT_IGNORE)
- break;
- }
- if(p.Y == min)
- goto plan_b;
- // If this node is not air, go to plan b
- if(getNodeNoEx(p).getContent() != CONTENT_AIR)
- goto plan_b;
- // Search existing walkable and return it
- for(; p.Y>min; p.Y--)
- {
- MapNode n = getNodeNoEx(p);
- if(content_walkable(n.d) && n.getContent() != CONTENT_IGNORE)
- return p.Y;
- }
-
- // Move to plan b
-plan_b:
-#endif
-
- /*
- Determine from map generator noise functions
- */
-
- s16 level = m_emerge->getGroundLevelAtPoint(p2d);
- return level;
-
- //double level = base_rock_level_2d(m_seed, p2d) + AVERAGE_MUD_AMOUNT;
- //return (s16)level;
-}
-
-void ServerMap::createDirs(const std::string &path)
-{
- if (!fs::CreateAllDirs(path)) {
- m_dout<<"ServerMap: Failed to create directory "
- <<"\""<<path<<"\""<<std::endl;
- throw BaseException("ServerMap failed to create directory");
- }
-}
-