From a299c39d7be7eee062f399f74213157c4ed22fe1 Mon Sep 17 00:00:00 2001 From: Anuken Date: Sun, 27 Oct 2019 20:30:31 -0400 Subject: [PATCH] Bugfixes --- core/src/io/anuke/mindustry/game/Schematics.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/core/src/io/anuke/mindustry/game/Schematics.java b/core/src/io/anuke/mindustry/game/Schematics.java index 2236fe484c..4504f988b2 100644 --- a/core/src/io/anuke/mindustry/game/Schematics.java +++ b/core/src/io/anuke/mindustry/game/Schematics.java @@ -45,6 +45,12 @@ public class Schematics implements Loadable{ previews.clear(); shadowBuffer.dispose(); }); + + Events.on(ContentReloadEvent.class, event -> { + previews.each((schem, m) -> m.dispose()); + previews.clear(); + load(); + }); } @Override @@ -64,9 +70,9 @@ public class Schematics implements Loadable{ all.sort(); - Core.app.post(() -> { - shadowBuffer = new FrameBuffer(maxSchematicSize + padding + 8, maxSchematicSize + padding + 8); - }); + if(shadowBuffer == null){ + Core.app.post(() -> shadowBuffer = new FrameBuffer(maxSchematicSize + padding + 8, maxSchematicSize + padding + 8)); + } } public void overwrite(Schematic target, Schematic newSchematic){