From 2c59a8abaf04760770ced972414fee213d9c49dd Mon Sep 17 00:00:00 2001 From: kaczy Date: Sun, 10 Dec 2023 17:01:30 +0100 Subject: [PATCH] Draw chance --- CentrED/Tools/DrawTool.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CentrED/Tools/DrawTool.cs b/CentrED/Tools/DrawTool.cs index d510008..b3d179b 100644 --- a/CentrED/Tools/DrawTool.cs +++ b/CentrED/Tools/DrawTool.cs @@ -1,6 +1,5 @@ using CentrED.Map; using CentrED.UI; -using CentrED.UI.Windows; using ClassicUO.Assets; using ImGuiNET; using Microsoft.Xna.Framework; @@ -10,6 +9,7 @@ namespace CentrED.Tools; public class DrawTool : Tool { + private static readonly Random Random = new(); public override string Name => "DrawTool"; private bool _pressed; @@ -187,7 +187,7 @@ public override void OnMouseReleased(TileObject? o) private void Apply(TileObject? o) { - if (o == null) return; + if (o == null || Random.Next(100) < _drawChance) return; var tilesWindow = CEDGame.UIManager.TilesWindow; if (tilesWindow.LandMode && o is LandObject lo) {