mirror of
https://github.com/DarkflameUniverse/DarkflameServer.git
synced 2025-08-04 01:34:07 +00:00
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:
@@ -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;
|
||||
|
Reference in New Issue
Block a user