From 05f722b397c23084c9587a0dd86b8812e4184065 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sun, 11 Jul 2021 16:48:05 -0400 Subject: [PATCH] Fix custom brush loading --- src/common/Platform.cpp | 6 ------ src/gui/game/GameModel.cpp | 2 +- 2 files changed, 1 insertion(+), 7 deletions(-) diff --git a/src/common/Platform.cpp b/src/common/Platform.cpp index c313586ff..d3415619e 100644 --- a/src/common/Platform.cpp +++ b/src/common/Platform.cpp @@ -299,9 +299,6 @@ std::vector DirectorySearch(ByteString directory, ByteString search, findFileHandle = _wfindfirst(Platform::WinWiden(fileMatch).c_str(), ¤tFile); if (findFileHandle == -1L) { -#ifdef DEBUG - printf("Unable to open directory: %s\n", directory.c_str()); -#endif return std::vector(); } do @@ -318,9 +315,6 @@ std::vector DirectorySearch(ByteString directory, ByteString search, DIR *directoryHandle = opendir(directory.c_str()); if (!directoryHandle) { -#ifdef DEBUG - printf("Unable to open directory: %s\n", directory.c_str()); -#endif return std::vector(); } while ((directoryEntry = readdir(directoryHandle))) diff --git a/src/gui/game/GameModel.cpp b/src/gui/game/GameModel.cpp index c5976f901..7431a179c 100644 --- a/src/gui/game/GameModel.cpp +++ b/src/gui/game/GameModel.cpp @@ -476,7 +476,7 @@ void GameModel::BuildBrushList() std::vector brushFiles = Platform::DirectorySearch(BRUSH_DIR, "", { ".ptb" }); for (size_t i = 0; i < brushFiles.size(); i++) { - std::vector brushData = Client::Ref().ReadFile(brushFiles[i]); + std::vector brushData = Client::Ref().ReadFile(BRUSH_DIR + ByteString(PATH_SEP) + brushFiles[i]); if(!brushData.size()) { std::cout << "Brushes: Skipping " << brushFiles[i] << ". Could not open" << std::endl;