diff --git a/Scripts/Chunk.cs b/Scripts/Chunk.cs index d6fff0c..342fe5c 100644 --- a/Scripts/Chunk.cs +++ b/Scripts/Chunk.cs @@ -76,8 +76,8 @@ public class Chunk { Type type = typeof(T); object o = Activator.CreateInstance(type, x, y, this); - // check if not empty: - if (Elements[x,y].GetType() != typeof(Element)) { + // check if not empty and overwrite not allowed: + if (Elements[x,y].GetType() != typeof(Element) && !Main.Instance.AllowOverwrite) { return; } diff --git a/Scripts/Main.cs b/Scripts/Main.cs index 50d9ce8..ac2cde7 100644 --- a/Scripts/Main.cs +++ b/Scripts/Main.cs @@ -4,6 +4,7 @@ using Godot; public partial class Main : Node2D { [Export] public bool DebugMode = false; + [Export] public bool AllowOverwrite = true; [Export] public int BrushSize = 5; [Export] public float TextureResolution = 0.5f;