Skip to content
Open
Changes from 4 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,14 @@ 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 path = Paths.get(mapDocumentPath).resolve(cachedMapFile.get().getName());
mapCopy = path.toFile();
mapCopy.mkdirs();
java.nio.file.Files.copy(cachedMapFile.get().toPath(), path, StandardCopyOption.REPLACE_EXISTING);
} else if (w3data.getWc3PatchVersion().isPresent()) {
GameVersion gameVersion = w3data.getWc3PatchVersion().get();
if (gameVersion.compareTo(GameVersion.VERSION_1_32) < 0) {
mapCopy = copyToWarcraftMapDir(cachedMapFile.get());
Expand Down
Loading