Allow servers to be run from directories other than build. Read/write files relative to binary instead of cwd (#834)

Allows the server to be run from a non-build directory.  Also only read or write files relative to the build directory, regardless of where the server is run from
This commit is contained in:
Jonathan Romano
2022-11-27 06:59:59 -05:00
committed by GitHub
parent e40a597f18
commit f8f5b731f1
16 changed files with 158 additions and 46 deletions

View File

@@ -7,6 +7,7 @@
#include "dPlatforms.h"
#include "NiPoint3.h"
#include "BinaryIO.h"
#include "BinaryPathFinder.h"
#include "dZoneManager.h"
@@ -43,7 +44,7 @@ dNavMesh::~dNavMesh() {
void dNavMesh::LoadNavmesh() {
std::string path = "./navmeshes/" + std::to_string(m_ZoneId) + ".bin";
std::string path = (BinaryPathFinder::GetBinaryDir() / "navmeshes/" / (std::to_string(m_ZoneId) + ".bin")).string();
if (!BinaryIO::DoesFileExist(path)) {
return;