@@ -34,7 +34,7 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
34
34
35
35
Label jump = generator . DefineLabel ( ) ;
36
36
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 ;
38
38
39
39
newInstructions [ index ] . labels . Add ( jump ) ;
40
40
@@ -44,22 +44,8 @@ private static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstructi
44
44
new ( OpCodes . Ldloc_2 ) ,
45
45
46
46
// 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>();
54
47
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 ) ) ) ,
63
49
64
50
// RoomChangedEventArgs ev = new RoomChangedEventArgs(hub, oldRoom, newRoom);
65
51
new ( OpCodes . Newobj , GetDeclaredConstructors ( typeof ( RoomChangedEventArgs ) ) [ 0 ] ) ,
0 commit comments