Fix custom brush loading

This commit is contained in:
jacob1 2021-07-11 16:48:05 -04:00
parent cfeda0fdba
commit 05f722b397
No known key found for this signature in database
GPG Key ID: 4E58A32D510E1995
2 changed files with 1 additions and 7 deletions

View File

@ -299,9 +299,6 @@ std::vector<ByteString> DirectorySearch(ByteString directory, ByteString search,
findFileHandle = _wfindfirst(Platform::WinWiden(fileMatch).c_str(), &currentFile);
if (findFileHandle == -1L)
{
#ifdef DEBUG
printf("Unable to open directory: %s\n", directory.c_str());
#endif
return std::vector<ByteString>();
}
do
@ -318,9 +315,6 @@ std::vector<ByteString> 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<ByteString>();
}
while ((directoryEntry = readdir(directoryHandle)))

View File

@ -476,7 +476,7 @@ void GameModel::BuildBrushList()
std::vector<ByteString> brushFiles = Platform::DirectorySearch(BRUSH_DIR, "", { ".ptb" });
for (size_t i = 0; i < brushFiles.size(); i++)
{
std::vector<unsigned char> brushData = Client::Ref().ReadFile(brushFiles[i]);
std::vector<unsigned char> 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;