@@ -62,6 +62,12 @@ public abstract class MapRequest extends UserRequest<Object> {
62
62
protected final W3InstallationData w3data ;
63
63
protected final TimeTaker timeTaker ;
64
64
65
+ public static long mapLastModified = 0L ;
66
+ public static String mapPath = "" ;
67
+
68
+ private static Long lastMapModified = 0L ;
69
+ private static String lastMapPath = "" ;
70
+
65
71
/**
66
72
* makes the compilation slower, but more safe by discarding results from the editor and working on a copy of the model
67
73
*/
@@ -378,7 +384,6 @@ protected CompilationResult compileScript(ModelManager modelManager, WurstGui gu
378
384
return result ;
379
385
}
380
386
381
- private static Long lastMapModified = 0L ;
382
387
383
388
private File loadMapScript (Optional <File > mapCopy , ModelManager modelManager , WurstGui gui ) throws Exception {
384
389
File scriptFile = new File (new File (workspaceRoot .getFile (), "wurst" ), "war3map.j" );
@@ -393,10 +398,10 @@ private File loadMapScript(Optional<File> mapCopy, ModelManager modelManager, Wu
393
398
"RunArg noExtractMapScript is set but no mapscript is provided inside the wurst folder" );
394
399
}
395
400
}
396
- long mapLastModified = mapCopy . get (). lastModified ();
397
- if ( mapLastModified > lastMapModified ) {
398
- lastMapModified = mapLastModified ;
399
- WLogger . info ( " extracting mapscript " );
401
+ if ( MapRequest . mapLastModified > lastMapModified || ! MapRequest . mapPath . equals ( lastMapPath )) {
402
+ lastMapModified = MapRequest . mapLastModified ;
403
+ lastMapPath = MapRequest . mapPath ;
404
+ System . out . println ( "Map not cached yet, extracting script " );
400
405
byte [] extractedScript = null ;
401
406
try (@ Nullable MpqEditor mpqEditor = MpqEditorFactory .getEditor (mapCopy , true )) {
402
407
if (mpqEditor .hasFile ("war3map.j" )) {
0 commit comments