Skip to content

Commit

Permalink
ensure that level directory exists when saving with level editor
Browse files Browse the repository at this point in the history
  • Loading branch information
HamaIndustries committed Sep 9, 2021
1 parent 322f6f9 commit 9147181
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion src/net/fe/editor/LevelEditorStage.java
Original file line number Diff line number Diff line change
Expand Up @@ -261,7 +261,12 @@ private void modifySize(int dx, int dy) {
}

private void save() {
Level level = new Level(tiles[0].length, tiles.length, tiles, spawns);
File levels = new File("levels");
if(!levels.exists()) {
levels.mkdir();
}

Level level = new Level(tiles[0].length, tiles.length, tiles, spawns);
File file = new File("levels/"+levelName+".lvl");
FileOutputStream fo;
ObjectOutputStream oos;
Expand Down

0 comments on commit 9147181

Please sign in to comment.