diff --git a/Source/ProjectRimFactory/Common/ConditionalPatchHelper.cs b/Source/ProjectRimFactory/Common/ConditionalPatchHelper.cs index 715b79f1..f47e9377 100644 --- a/Source/ProjectRimFactory/Common/ConditionalPatchHelper.cs +++ b/Source/ProjectRimFactory/Common/ConditionalPatchHelper.cs @@ -77,10 +77,6 @@ public void PatchHandler(bool patch) AccessTools.Method(typeof(Verse.Thing), "Print", new Type[] { typeof(SectionLayer) }), AccessTools.Method(typeof(ProjectRimFactory.Common.HarmonyPatches.Patch_Thing_Print), "Prefix") ); - public static TogglePatch Patch_ThingWithComps_Draw = new TogglePatch( - AccessTools.Method(typeof(Verse.ThingWithComps), "Draw"), - AccessTools.Method(typeof(ProjectRimFactory.Common.HarmonyPatches.Patch_ThingWithComps_Draw), "Prefix") - ); public static TogglePatch Patch_ThingWithComps_DrawGUIOverlay = new TogglePatch( AccessTools.Method(typeof(Verse.ThingWithComps), "DrawGUIOverlay"), AccessTools.Method(typeof(ProjectRimFactory.Common.HarmonyPatches.Patch_ThingWithComps_DrawGUIOverlay), "Prefix") @@ -119,7 +115,6 @@ private static void updatePatchStorage() Patch_MinifiedThing_Print.PatchHandler(state); Patch_Thing_Print.PatchHandler(state); - Patch_ThingWithComps_Draw.PatchHandler(state); Patch_ThingWithComps_DrawGUIOverlay.PatchHandler(state); Patch_Thing_DrawGUIOverlay.PatchHandler(state); Patch_FloatMenuMakerMap_ChoicesAtFor.PatchHandler(state); diff --git a/Source/ProjectRimFactory/Common/HarmonyPatches/PatchStorage.cs b/Source/ProjectRimFactory/Common/HarmonyPatches/PatchStorage.cs index cb4d7071..a9a244fa 100644 --- a/Source/ProjectRimFactory/Common/HarmonyPatches/PatchStorage.cs +++ b/Source/ProjectRimFactory/Common/HarmonyPatches/PatchStorage.cs @@ -92,21 +92,6 @@ static bool Prefix(Thing __instance) } } - class Patch_ThingWithComps_Draw - { - static bool Prefix(Thing __instance) - { - if (__instance.def.category == ThingCategory.Item) - { - if (PatchStorageUtil.GetPRFMapComponent(__instance.Map)?.ShouldHideItemsAtPos(__instance.Position) ?? false) - { - return false; - } - } - return true; - } - } - class Patch_Thing_Print { static bool Prefix(Thing __instance, SectionLayer layer) diff --git a/Source/ProjectRimFactory/Storage/Building_MassStorageUnit.cs b/Source/ProjectRimFactory/Storage/Building_MassStorageUnit.cs index 5ada1e87..c373063a 100644 --- a/Source/ProjectRimFactory/Storage/Building_MassStorageUnit.cs +++ b/Source/ProjectRimFactory/Storage/Building_MassStorageUnit.cs @@ -52,7 +52,7 @@ public abstract class Building_MassStorageUnit : Building_Storage, IHideItem, IH public override void Notify_ReceivedThing(Thing newItem) { base.Notify_ReceivedThing(newItem); - if (newItem.Position != Position) RegisterNewItem(newItem); + if (newItem.Position != Position) HandleNewItem(newItem); RefreshStorage(); } @@ -229,7 +229,7 @@ public virtual void RefreshStorage() { if (cell != Position) { - RegisterNewItem(item); + HandleNewItem(item); } else { @@ -309,6 +309,7 @@ public bool StackableAt(Thing thing, IntVec3 cell, Map map) public void HandleNewItem(Thing item) { RegisterNewItem(item); + Map.dynamicDrawManager.DeRegisterDrawable(item); } public void HandleMoveItem(Thing item)