File tree Expand file tree Collapse file tree 1 file changed +28
-1
lines changed
Expand file tree Collapse file tree 1 file changed +28
-1
lines changed Original file line number Diff line number Diff line change @@ -123,7 +123,34 @@ static void Postfix(ref FloodUnfogResult __result)
123123 __result . allOnScreen = false ;
124124 }
125125 }
126-
126+
127+ [ HarmonyPatch ]
128+ static class UnnaturalCorpsePatch // v1.5
129+ {
130+ static IEnumerable < MethodBase > TargetMethods ( )
131+ {
132+ yield return AccessTools . DeclaredMethod ( typeof ( AnomalyUtility ) , nameof ( AnomalyUtility . IsValidUnseenCell ) ) ;
133+ yield return AccessTools . DeclaredMethod ( typeof ( UnnaturalCorpse ) , nameof ( UnnaturalCorpse . IsOutsideView ) ) ;
134+ }
135+
136+ static MethodInfo CellRectContains = AccessTools . Method ( typeof ( CellRect ) , nameof ( CellRect . Contains ) ) ;
137+
138+ static IEnumerable < CodeInstruction > Transpiler ( IEnumerable < CodeInstruction > insts )
139+ {
140+ foreach ( var inst in insts )
141+ {
142+ yield return inst ;
143+
144+ // consider it always outside view (not contained in CurrentViewRect)
145+ if ( inst . operand == CellRectContains )
146+ {
147+ yield return new CodeInstruction ( OpCodes . Ldc_I4_0 ) ;
148+ yield return new CodeInstruction ( OpCodes . And ) ;
149+ }
150+ }
151+ }
152+ }
153+
127154 [ HarmonyPatch ( typeof ( Pawn ) , nameof ( Pawn . ProcessPostTickVisuals ) ) ]
128155 static class DrawTrackerTickPatch
129156 {
You can’t perform that action at this time.
0 commit comments