@@ -34,7 +34,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
3434
3535 Label jump = generator . DefineLabel ( ) ;
3636 int offset = 2 ;
37- int index = newInstructions . FindIndex ( x => x == ( object ) Method ( typeof ( PlayerEvents ) , "op_Inequality" , new [ ] { typeof ( Object ) , typeof ( Object ) } ) ) + offset ;
37+ int index = newInstructions . FindIndex ( x => x == ( object ) Method ( typeof ( Object ) , "op_Inequality" , new [ ] { typeof ( Object ) , typeof ( Object ) } ) ) + offset ;
3838
3939 newInstructions [ index ] . labels . Add ( jump ) ;
4040
@@ -44,22 +44,8 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
4444 new ( OpCodes . Ldloc_2 ) ,
4545
4646 // newRoom
47- new ( OpCodes . Ldloc_3 ) ,
48-
49- // if (oldRoom == newRoom) goto jump;
50- new ( OpCodes . Call , Method ( typeof ( object ) , nameof ( object . ReferenceEquals ) , new [ ] { typeof ( object ) , typeof ( object ) } ) ) ,
51- new ( OpCodes . Brtrue_S , jump ) ,
52-
53- // this._roleManager.gameObject.GetComponent<ReferenceHub>();
5447 new ( OpCodes . Ldarg_0 ) ,
55- new ( OpCodes . Ldfld , Field ( typeof ( CurrentRoomPlayerCache ) , nameof ( CurrentRoomPlayerCache . _roleManager ) ) ) ,
56- new ( OpCodes . Call , Method ( typeof ( Component ) , nameof ( Component . GetComponent ) ) . MakeGenericMethod ( typeof ( ReferenceHub ) ) ) ,
57-
58- // oldRoom
59- new ( OpCodes . Ldloc_2 ) ,
60-
61- // newRoom
62- new ( OpCodes . Ldloc_3 ) ,
48+ new ( OpCodes . Ldfld , Field ( typeof ( CurrentRoomPlayerCache ) , nameof ( CurrentRoomPlayerCache . _lastDetected ) ) ) ,
6349
6450 // RoomChangedEventArgs ev = new RoomChangedEventArgs(hub, oldRoom, newRoom);
6551 new ( OpCodes . Newobj , GetDeclaredConstructors ( typeof ( RoomChangedEventArgs ) ) [ 0 ] ) ,
0 commit comments