Skip to content
Open
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 @@ -25,8 +25,10 @@
import java.io.File;
import java.io.FileNotFoundException;
import java.io.IOException;
import java.nio.file.CopyOption;
import java.nio.file.Path;
import java.nio.file.Paths;
import java.nio.file.StandardCopyOption;
import java.time.Duration;
import java.util.Arrays;
import java.util.List;
Expand Down Expand Up @@ -130,7 +132,15 @@ private void startGame(WurstGui gui, CompilationResult result) throws Exception
gui.sendProgress("Starting Warcraft 3...");

File mapCopy = cachedMapFile.get();
if (w3data.getWc3PatchVersion().isPresent()) {

String mapDocumentPath = langServer.getConfigProvider().getConfig("mapDocumentPath", "");
if (!mapDocumentPath.isEmpty()) {
Path parent = Paths.get(mapDocumentPath);
parent.toFile().mkdirs();
Path path = parent.resolve(cachedMapFile.get().getName());
mapCopy = path.toFile();
java.nio.file.Files.copy(cachedMapFile.get().toPath(), path, StandardCopyOption.REPLACE_EXISTING);
} else if (w3data.getWc3PatchVersion().isPresent()) {
Comment on lines +136 to +143

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge Honor -runmapTarget when mapDocumentPath is set

The new mapDocumentPath branch executes before copyToWarcraftMapDir, so when a user configures mapDocumentPath the call that parses -runmapTarget in copyToWarcraftMapDir (lines 256‑263) is skipped and customTarget is never set. As a result, runs started with both a configured map document path and a -runmapTarget <dir> argument now always copy and launch the map from mapDocumentPath, silently ignoring the explicit CLI override that previously selected the output directory for pre‑1.32 clients.

Useful? React with 👍 / 👎.

GameVersion gameVersion = w3data.getWc3PatchVersion().get();
if (gameVersion.compareTo(GameVersion.VERSION_1_32) < 0) {
mapCopy = copyToWarcraftMapDir(cachedMapFile.get());
Expand Down
Loading