From 5e8aec321024564f3c4cebd7195d1b41dfae7d70 Mon Sep 17 00:00:00 2001 From: Sofistico Date: Mon, 2 Jun 2025 10:51:18 -0300 Subject: [PATCH 1/2] making the value change when the value is different from before --- GoRogue/GameFramework/Map.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/GoRogue/GameFramework/Map.cs b/GoRogue/GameFramework/Map.cs index 1b86b0fb..b718e0bf 100644 --- a/GoRogue/GameFramework/Map.cs +++ b/GoRogue/GameFramework/Map.cs @@ -277,7 +277,7 @@ private Map(ISettableGridView terrainLayer, Distance distanceMeasu if (useCachedGridViews) { - + _cachedTransparencyView = new BitArrayView(_terrain.Width, _terrain.Height); TransparencyView = _cachedTransparencyView; _cachedWalkabilityView = new BitArrayView(_terrain.Width, _terrain.Height); @@ -363,7 +363,7 @@ private void Map_ObjectRemovedSyncViews(object? sender, ItemEventArgs e) { var obj = (IGameObject)sender!; - if (e.NewValue) + if (e.NewValue != e.OldValue) _cachedTransparencyView![obj.Position] = LayersBlockingTransparency == 1 ? _terrain[obj.Position]?.IsTransparent ?? true : FullIsTransparent(obj.Position); From b9d623d202db1a9941623f8f13d58606c2536feb Mon Sep 17 00:00:00 2001 From: Sofistico Date: Mon, 2 Jun 2025 10:52:54 -0300 Subject: [PATCH 2/2] Weird spacing --- GoRogue/GameFramework/Map.cs | 1 - 1 file changed, 1 deletion(-) diff --git a/GoRogue/GameFramework/Map.cs b/GoRogue/GameFramework/Map.cs index b718e0bf..2170c346 100644 --- a/GoRogue/GameFramework/Map.cs +++ b/GoRogue/GameFramework/Map.cs @@ -277,7 +277,6 @@ private Map(ISettableGridView terrainLayer, Distance distanceMeasu if (useCachedGridViews) { - _cachedTransparencyView = new BitArrayView(_terrain.Width, _terrain.Height); TransparencyView = _cachedTransparencyView; _cachedWalkabilityView = new BitArrayView(_terrain.Width, _terrain.Height);