From 2acfb3161692cd5c3816be9e8e9ec05c014ad13e Mon Sep 17 00:00:00 2001 From: Deku <39616108+DekuDesu@users.noreply.github.com> Date: Mon, 14 Mar 2022 21:37:32 -0400 Subject: [PATCH] fixed typo causing all items to be always selected to be placed on minimap even if they should be filtered out --- MiniMapMod/MiniMapPlugin.cs | 6 +++--- MiniMapMod/Minimap.cs | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/MiniMapMod/MiniMapPlugin.cs b/MiniMapMod/MiniMapPlugin.cs index 94229bc..8652d3d 100644 --- a/MiniMapMod/MiniMapPlugin.cs +++ b/MiniMapMod/MiniMapPlugin.cs @@ -239,7 +239,7 @@ private void ScanStaticTypes() if (token is null) { Log.LogDebug($"No {nameof(PurchaseInteraction)} component on {nameof(ChestBehavior)}. GameObject.name = {chest.gameObject.name}"); - return true; + return false; } return token.Contains("CHEST") && token != "LUNAR_CHEST_CONTEXT" && token.Contains("STEALTH") == false; @@ -301,7 +301,7 @@ private void ScanStaticTypes() }); // duplicators - RegisterMonobehaviorType(InteractableKind.Printer, dynamicObject: false, + RegisterMonobehaviorType(InteractableKind.Printer, dynamicObject: false, selector: shop => shop?.contextToken?.Contains("DUPLICATOR") ?? false); // barrels @@ -378,7 +378,7 @@ private void RegisterMonobehaviorType(InteractableKind kind, Func Ac Log.LogDebug($"Selected {selected.Count()} {kind}s"); - RegisterMonobehaviours(found, kind, ActiveChecker, dynamicObject); + RegisterMonobehaviours(selected, kind, ActiveChecker, dynamicObject); } /// diff --git a/MiniMapMod/Minimap.cs b/MiniMapMod/Minimap.cs index 18a47c8..87cbc51 100644 --- a/MiniMapMod/Minimap.cs +++ b/MiniMapMod/Minimap.cs @@ -74,7 +74,7 @@ public void SetRotation(Quaternion rotation) public RectTransform CreateIcon(InteractableKind type, Vector3 minimapPosition, ISpriteManager spriteManager) { - Sprite sprite = null; + Sprite sprite; try { @@ -84,6 +84,8 @@ public RectTransform CreateIcon(InteractableKind type, Vector3 minimapPosition, { Log.LogError($"Failed to get sprite for type {type}"); Log.LogError(e.Message); + + return null; } GameObject icon = CreateIcon(type, sprite);