Whoops, I am bad programmer

This commit is contained in:
comp500 2019-08-10 02:18:02 +01:00
parent eaed3b2187
commit dcf8d21aad
2 changed files with 11 additions and 3 deletions

View File

@ -187,7 +187,7 @@ class DownloadTask implements IOptionDetails {
public boolean correctSide() { public boolean correctSide() {
if (metadata.linkedFile != null) { if (metadata.linkedFile != null) {
return downloadSide.hasSide(metadata.linkedFile.side); return metadata.linkedFile.side.hasSide(downloadSide);
} }
return true; return true;
} }

View File

@ -323,8 +323,16 @@ public class UpdateManager {
task = null; task = null;
} }
// Update manifest - If there were no errors cachedFile has already been modified in place (good old pass by reference) // Update manifest - If there were no errors cachedFile has already been modified in place (good old pass by reference)
if (task != null && task.getException() != null) { if (task != null) {
manifest.cachedFiles.put(task.metadata.file, task.cachedFile.getRevert()); if (task.getException() != null) {
ManifestFile.File file = task.cachedFile.getRevert();
if (file != null) {
manifest.cachedFiles.put(task.metadata.file, file);
}
} else {
// idiot, if it wasn't there in the first place it won't magically appear there
manifest.cachedFiles.putIfAbsent(task.metadata.file, task.cachedFile);
}
} }
// TODO: show errors properly? // TODO: show errors properly?
String progress; String progress;