File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 22using System . Linq ;
33using System . Reflection ;
44using NLog ;
5+ using Sandbox ;
56using Sandbox . Game . Entities ;
67using Sandbox . Game . Weapons ;
78using Torch . Managers . PatchManager ;
@@ -14,22 +15,15 @@ namespace FixTurrets
1415 [ PatchShim ]
1516 public static class FixTurretsPatch
1617 {
17-
18- private static int _counter = 0 ;
19- private static readonly int skipConst = 100 ;
2018
2119 [ ReflectedMethod ( Name = "RotateModels" ) ]
2220 private static Action < MyLargeTurretBase > RotateModels ;
2321
2422 private static void OnPositionChanged ( MyPositionComponentBase myPositionComponentBase , MyLargeTurretBase __instance )
2523 {
26- _counter ++ ;
27- if ( _counter % skipConst == 0 )
28- {
24+ if ( ( ulong ) __instance . EntityId % 100 == MySandboxGame . Static . SimulationFrameCounter % 100 ) {
2925 RotateModels . Invoke ( __instance ) ;
30- _counter = 0 ;
3126 }
32-
3327 }
3428
3529 public static readonly Logger Log = LogManager . GetCurrentClassLogger ( ) ;
You can’t perform that action at this time.
0 commit comments