This commit is contained in:
ChipsEater 2022-11-22 15:59:06 +04:00
parent d553376508
commit 8abded35c8

View File

@ -147,6 +147,7 @@ public class MapsCollection {
if (!map.getMap().getClass().getSimpleName().equals(reader.readLine())) { if (!map.getMap().getClass().getSimpleName().equals(reader.readLine())) {
return false; return false;
} }
map._setArtilleries.clear();
} else { } else {
map = switch (reader.readLine()) { map = switch (reader.readLine()) {
case "SimpleMap" -> new MapWithSetArtilleriesGeneric<>(_pictureWidth, _pictureHeight, new SimpleMap()); case "SimpleMap" -> new MapWithSetArtilleriesGeneric<>(_pictureWidth, _pictureHeight, new SimpleMap());
@ -155,8 +156,6 @@ public class MapsCollection {
}; };
} }
map._setArtilleries.clear();
while ((currentLine = reader.readLine()) != null) { while ((currentLine = reader.readLine()) != null) {
map._setArtilleries.insert(DrawingObjectArtillery.create(currentLine)); map._setArtilleries.insert(DrawingObjectArtillery.create(currentLine));
} }