Skip to content

Commit 8806112

Browse files
committedOct 27, 2021
fix(map): get the absolute game path
1 parent f98b56e commit 8806112

File tree

1 file changed

+5
-6
lines changed

1 file changed

+5
-6
lines changed
 

‎packages/map/map/main.c

+5-6
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ int main(int argc, char *argv[]) {
9292

9393
char c[INPUT_BUFFER];
9494

95-
char *gameFolder = NULL;
95+
char gamePath[MAX_PATH];
9696
DWORD argSeed = 0xff00ff00;
9797
int argMapId = -1;
9898
int argDifficulty = 0;
@@ -120,8 +120,8 @@ int main(int argc, char *argv[]) {
120120
log_debug("Cli:Arg", lk_b("verbose", true));
121121
log_level(LOG_TRACE);
122122
} else {
123-
gameFolder = arg;
124-
log_debug("Cli:Arg", lk_s("game", gameFolder));
123+
GetFullPathName(arg, MAX_PATH, gamePath, NULL);
124+
log_debug("Cli:Arg", lk_s("game", gamePath));
125125
}
126126
}
127127

@@ -131,14 +131,13 @@ int main(int argc, char *argv[]) {
131131
printf(CliUsage);
132132
return 1;
133133
}
134-
if (gameFolder == NULL) {
134+
if (gamePath == NULL) {
135135
printf(CliUsage);
136136
return 1;
137137
}
138138

139-
140139
int64_t initStartTime = currentTimeMillis();
141-
d2_game_init(gameFolder);
140+
d2_game_init(gamePath);
142141
int64_t duration = currentTimeMillis() - initStartTime;
143142
log_info("Map:Init:Done", lk_s("version", GIT_VERSION), lk_s("hash", GIT_HASH), lk_i("duration", duration));
144143

0 commit comments

Comments
 (0)
Please sign in to comment.