@@ -44,25 +44,22 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
4444 Label ret = generator . DefineLabel ( ) ;
4545 Label end = generator . DefineLabel ( ) ;
4646
47- int offset = 0 ;
48- int index = newInstructions . FindIndex ( i => i . LoadsConstant ( 0 ) ) + offset ;
47+ int index = newInstructions . FindIndex ( i => i . LoadsConstant ( 0 ) ) ;
4948
5049 newInstructions [ index ] . labels . Add ( ret ) ;
5150
5251 newInstructions . InsertRange ( index , StaticCallEvent ( generator , ev , ret , newInstructions [ index ] , Scp939VisibilityState . None , false ) ) ;
5352
54- offset = 0 ;
55- index = newInstructions . FindIndex ( i => i . LoadsConstant ( 1 ) ) + offset ;
53+ index = newInstructions . FindIndex ( i => i . LoadsConstant ( 1 ) ) ;
5654
5755 newInstructions . InsertRange ( index , StaticCallEvent ( generator , ev , ret , newInstructions [ index ] , Scp939VisibilityState . SeenAsScp ) ) ;
5856
59- offset = 2 ;
57+ int offset = 4 ;
6058 index = newInstructions . FindIndex ( i => i . Calls ( PropertyGetter ( typeof ( AlphaWarheadController ) , nameof ( AlphaWarheadController . Detonated ) ) ) ) + offset ;
6159
6260 newInstructions . InsertRange ( index , StaticCallEvent ( generator , ev , ret , newInstructions [ index ] , Scp939VisibilityState . SeenByDetonation ) ) ;
6361
64- offset = 0 ;
65- index = newInstructions . FindLastIndex ( i => i . opcode == OpCodes . Ldloc_3 ) + offset ;
62+ index = newInstructions . FindLastIndex ( i => i . opcode == OpCodes . Ldloc_3 ) ;
6663
6764 // just pre-check for SeenByLastTime or NotSeen VisibilityState, and then il inject
6865 newInstructions . InsertRange ( index , Enumerable . Concat (
@@ -77,8 +74,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
7774 } ,
7875 CallEvent ( generator , ev , ret ) ) ) ;
7976
80- offset = 0 ;
81- index = newInstructions . FindLastIndex ( i => i . LoadsField ( Field ( typeof ( Scp939VisibilityController ) , nameof ( Scp939VisibilityController . LastSeen ) ) ) ) + offset ;
77+ index = newInstructions . FindLastIndex ( i => i . LoadsField ( Field ( typeof ( Scp939VisibilityController ) , nameof ( Scp939VisibilityController . LastSeen ) ) ) ) ;
8278
8379 newInstructions . InsertRange ( index , StaticCallEvent ( generator , ev , ret , newInstructions [ index ] , Scp939VisibilityState . SeenByRange ) ) ;
8480
0 commit comments