pathfinder_interface.cpp 617 B

123456789101112131415161718192021
  1. #include "../../common/Log.h"
  2. #include "../client.h"
  3. #include "pathfinder_null.h"
  4. #include "pathfinder_nav_mesh.h"
  5. #include "pathfinder_waypoint.h"
  6. #include <sys/stat.h>
  7. IPathfinder *IPathfinder::Load(const std::string &zone) {
  8. struct stat statbuffer;
  9. //std::string navmesh_path = fmt::format("maps/nav/{0}.nav", zone);
  10. std::string navmesh_path = "Maps/nav/" + zone + ".nav";
  11. if (stat(navmesh_path.c_str(), &statbuffer) == 0) {
  12. return new PathfinderNavmesh(navmesh_path);
  13. }
  14. else
  15. LogWrite(MAP__INFO, 7, "Map", "Could not find Navmesh File [{%s}]", navmesh_path.c_str());
  16. return new PathfinderNull();
  17. }