From af326bfeb8d060ab6a2f3c959103f1f93f0dad41 Mon Sep 17 00:00:00 2001 From: RoosterDragon Date: Tue, 11 Nov 2025 18:08:06 +0000 Subject: [PATCH] Fix IDE0031 --- OpenRA.Game/Graphics/CursorManager.cs | 7 ++----- OpenRA.Game/Map/MapPreview.cs | 7 ++----- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/OpenRA.Game/Graphics/CursorManager.cs b/OpenRA.Game/Graphics/CursorManager.cs index c022edf6d6..d86b619c22 100644 --- a/OpenRA.Game/Graphics/CursorManager.cs +++ b/OpenRA.Game/Graphics/CursorManager.cs @@ -283,11 +283,8 @@ namespace OpenRA.Graphics { for (var i = 0; i < c.Cursors.Length; i++) { - if (c.Cursors[i] != null) - { - c.Cursors[i].Dispose(); - c.Cursors[i] = null; - } + c.Cursors[i]?.Dispose(); + c.Cursors[i] = null; } } } diff --git a/OpenRA.Game/Map/MapPreview.cs b/OpenRA.Game/Map/MapPreview.cs index 7aa37788f6..9c951275db 100644 --- a/OpenRA.Game/Map/MapPreview.cs +++ b/OpenRA.Game/Map/MapPreview.cs @@ -663,11 +663,8 @@ namespace OpenRA public void Dispose() { - if (package != null) - { - package.Dispose(); - package = null; - } + package?.Dispose(); + package = null; } public void Delete()