From 6c3ccb259fb6bcf84c50ba0770120ee91e6f2b8c Mon Sep 17 00:00:00 2001 From: Anuken Date: Mon, 11 Mar 2019 13:27:15 -0400 Subject: [PATCH] Some errors fixed --- core/src/io/anuke/mindustry/editor/DrawOperation.java | 5 +++++ core/src/io/anuke/mindustry/editor/MapEditor.java | 6 ++++++ 2 files changed, 11 insertions(+) diff --git a/core/src/io/anuke/mindustry/editor/DrawOperation.java b/core/src/io/anuke/mindustry/editor/DrawOperation.java index 49765644b5..bfa6b25673 100755 --- a/core/src/io/anuke/mindustry/editor/DrawOperation.java +++ b/core/src/io/anuke/mindustry/editor/DrawOperation.java @@ -30,6 +30,11 @@ public class DrawOperation{ class TileOpStruct{ short x; short y; + /** + * 0: floor + * 1: block + * 2: rotation + */ byte type; byte from; byte to; diff --git a/core/src/io/anuke/mindustry/editor/MapEditor.java b/core/src/io/anuke/mindustry/editor/MapEditor.java index afa19d6f0e..9a2b2d427b 100644 --- a/core/src/io/anuke/mindustry/editor/MapEditor.java +++ b/core/src/io/anuke/mindustry/editor/MapEditor.java @@ -235,6 +235,12 @@ public class MapEditor{ renderer.resize(width, height); } + public void changeFloor(int x, int y, Block to){ + Block from = tiles[x][y].floor(); + tiles[x][y].setFloor((Floor)to); + addTileOp(TileOp.get((short)x, (short)y, (byte)0, from.id, to.id)); + } + public void undo(){ if(stack.canUndo()){ stack.undo(this);