File tree Expand file tree Collapse file tree
SentisOptimisations/Freezer Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,6 +145,10 @@ private static void CompensateFrozenFrames(MyCubeGrid grid)
145145 }
146146 }
147147 }
148+ else
149+ {
150+ LastUpdateFrames . Remove ( myCubeBlock . EntityId ) ;
151+ }
148152 }
149153 }
150154
@@ -356,9 +360,13 @@ private static void DoUnfreezePhysics(MyCubeGrid grid)
356360
357361 public static bool NeedToCompensate ( MyFunctionalBlock myCubeBlock )
358362 {
363+ if ( myCubeBlock == null || ! myCubeBlock . IsWorking )
364+ {
365+ return false ;
366+ }
367+
359368 var needToCompensate = myCubeBlock is MyProductionBlock
360- || myCubeBlock is MyGasGenerator
361- || myCubeBlock is MyFueledPowerProducer ;
369+ || myCubeBlock is MyGasTank ;
362370 return needToCompensate ;
363371 }
364372
Original file line number Diff line number Diff line change 11using System ;
22using System . Reflection ;
3+ using NLog . Fluent ;
34using Sandbox . Engine . Physics ;
45using Sandbox . Game ;
56using Sandbox . Game . Entities ;
7+ using Sandbox . Game . Entities . Blocks ;
68using Sandbox . Game . Entities . Cube ;
79using Sandbox . Game . Entities . Inventory ;
10+ using Sandbox . Game . EntityComponents ;
811using Torch . Managers . PatchManager ;
912using VRage ;
1013using VRage . Game ;
@@ -28,7 +31,7 @@ public static void Patch(PatchContext ctx)
2831 ctx . GetPattern ( MethodAddItems ) . Prefixes . Add (
2932 typeof ( FreezerPatches ) . GetMethod ( nameof ( AddItemsPatched ) ,
3033 BindingFlags . Static | BindingFlags . Instance | BindingFlags . NonPublic ) ) ;
31-
34+
3235 var MethodOnMotionDynamic = typeof ( MyPhysicsBody ) . GetMethod
3336 ( "OnMotionDynamic" , BindingFlags . Instance | BindingFlags . Public | BindingFlags . DeclaredOnly ) ;
3437
@@ -45,7 +48,7 @@ public static void Patch(PatchContext ctx)
4548 typeof ( FreezerPatches ) . GetMethod ( nameof ( RefreshCustomInfoPatched ) ,
4649 BindingFlags . Static | BindingFlags . Instance | BindingFlags . NonPublic ) ) ;
4750 }
48-
51+
4952 private static bool RefreshCustomInfoPatched ( MyTerminalBlock __instance )
5053 {
5154 if ( ! SentisOptimisationsPlugin . Config . FreezerEnabled )
You can’t perform that action at this time.
0 commit comments