Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ public MapRequest(WurstLanguageServer langServer, Optional<File> map, List<Strin
this.runArgs = new RunArgs(compileArgs);
this.wc3Path = wc3Path;
if (gameExePath.isPresent() && StringUtils.isNotBlank(gameExePath.get())) {
this.w3data = new W3InstallationData(Optional.of(new File(gameExePath.get())), Optional.of(GameVersion.VERSION_1_29));
this.w3data = new W3InstallationData(Optional.of(new File(gameExePath.get())), Optional.empty());
} else {
this.w3data = getBestW3InstallationData();
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,14 @@ public W3InstallationData(Optional<File> gameExe, Optional<GameVersion> version)
this.languageServer = null;
this.gameExe = gameExe;
this.version = version;
if (!this.version.isPresent() && this.gameExe.isPresent()) {
try {
this.version = Optional.ofNullable(GameExe.getVersion(this.gameExe.get()));
WLogger.info("Parsed game version from configured executable: " + this.version);
} catch (IOException e) {
WLogger.warning("Could not parse game version from configured executable", e);
}
}
}

/** Evaluates the game path and version by discovering the system environment. */
Expand Down
Loading