Skip to content

Commit

Permalink
Draw chance
Browse files Browse the repository at this point in the history
  • Loading branch information
kaczy93 committed Dec 10, 2023
1 parent 57e3114 commit 2c59a8a
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions CentrED/Tools/DrawTool.cs
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
using CentrED.Map;
using CentrED.UI;
using CentrED.UI.Windows;
using ClassicUO.Assets;
using ImGuiNET;
using Microsoft.Xna.Framework;
Expand All @@ -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;
Expand Down Expand Up @@ -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)
{
Expand Down

0 comments on commit 2c59a8a

Please sign in to comment.