Skip to content

Commit 3a29b65

Browse files
committed
Fix Enigma dir writer behaving incorrectly after first write when using MIO
1 parent 6fd510c commit 3a29b65

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

enigma/src/main/java/cuchaz/enigma/translation/mapping/serde/MappingFormat.java

+2-1
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ public void write(EntryTree<EntryMapping> mappings, MappingDelta<EntryMapping> d
8080
try {
8181
if (this == ENIGMA_DIRECTORY) { // TODO: Remove once MIO supports deltas
8282
EnigmaMappingsWriter.DIRECTORY.write(mappings, lastUsedMappingIoWriter ? MappingDelta.added(mappings) : delta, path, progressListener, saveParameters, true);
83+
lastUsedMappingIoWriter = false;
8384
} else {
8485
if (this == PROGUARD) {
8586
mappings = MappingOperations.invert(mappings);
@@ -91,9 +92,9 @@ public void write(EntryTree<EntryMapping> mappings, MappingDelta<EntryMapping> d
9192

9293
tree.accept(MappingWriter.create(path, mappingIoCounterpart), VisitOrder.createByName());
9394
progressListener.step(1, I18n.translate("progress.done"));
95+
lastUsedMappingIoWriter = true;
9496
}
9597

96-
lastUsedMappingIoWriter = true;
9798
} catch (IOException e) {
9899
throw new UncheckedIOException(e);
99100
}

0 commit comments

Comments
 (0)