Skip to content

Commit

Permalink
Vehicles: Minor fixup of usage on windows
Browse files Browse the repository at this point in the history
Closes #436
  • Loading branch information
killerwife committed Oct 26, 2023
1 parent dbb5630 commit 6f6ef67
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
7 changes: 5 additions & 2 deletions contrib/extractor/System.cpp
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
#define _CRT_SECURE_NO_DEPRECATE
#define __STDC_LIMIT_MACROS

#include <sstream>
#include <fstream>
#define _CRT_SECURE_NO_DEPRECATE

#include <stdio.h>
#include <deque>
Expand Down Expand Up @@ -129,7 +131,7 @@ void Usage(char* prg)
"%s -[var] [value]\n"\
"-i set input path\n"\
"-o set output path\n"\
"-e extract only MAP(1)/DBC(2)/Camera(4) - standard: all(15)\n"\
"-e extract only MAP(1)/DBC(2)/Camera(4)/Attachment(8) - standard: all(15)\n"\
"-f height stored as int (less map size but lost some accuracy) 1 by default\n"\
"Example: %s -f 0 -i \"c:\\games\\game\"", prg, prg);
exit(1);
Expand Down Expand Up @@ -1128,6 +1130,7 @@ void ExtractCreatureModelFiles(int locale, bool basicLocale)

auto pos = thisFile.find_last_of('\\');
std::string pureName = thisFile;
std::replace(pureName.begin(), pureName.end(), '\\', '_');
filename += pureName;

if (FileExists(filename.c_str()))
Expand Down
4 changes: 4 additions & 0 deletions contrib/extractor_scripts/ExtractResources.sh
Original file line number Diff line number Diff line change
Expand Up @@ -276,6 +276,10 @@ fi
## Extract creature models
if [ "$USE_MODELS" = "1" ] && [ "$USE_AD" = "0" ]
then
if [ ! -d "${OUTPUT_PATH:-.}/vmaps" ]
then
mkdir "${OUTPUT_PATH:-.}/vmaps"
fi
echo "$(date): Start extraction of model files..." | tee -a $LOG_FILE
$PREFIX/ad -e 8 | tee -a $DETAIL_LOG_FILE
echo "$(date): Extracting of model files finished" | tee -a $LOG_FILE
Expand Down
4 changes: 3 additions & 1 deletion src/game/Models/M2Stores.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,9 @@ void LoadM2Attachments(std::string const& dataPath)
{
std::string filename = dataPath;
filename.append("CreatureModels/");
filename.append(dbcentry->ModelPath);
std::string modelPath = dbcentry->ModelPath;
std::replace(modelPath.begin(), modelPath.end(), '\\', '_');
filename.append(modelPath);

// Replace mdx to .m2
size_t loc = filename.find(".mdx");
Expand Down

0 comments on commit 6f6ef67

Please sign in to comment.