@@ -50,7 +50,7 @@ static bool Prefix(Quest quest, ref bool __result)
5050 if ( quest . TryGetPlayerFaction ( out playerFaction ) && playerFaction != Faction . OfPlayer )
5151 {
5252 __result = false ;
53- return false ;
53+ return false ;
5454 }
5555 }
5656 return true ;
@@ -82,8 +82,8 @@ static class WorldInspectPanePaneTopYPatch
8282{
8383 static void Postfix ( ref float __result )
8484 {
85- if ( Multiplayer . Client != null && Multiplayer . RealPlayerFaction == Multiplayer . WorldComp . spectatorFaction )
86- __result += 35f ;
85+ if ( Multiplayer . Client != null && Multiplayer . RealPlayerFaction == Multiplayer . WorldComp . spectatorFaction )
86+ __result += 35f ;
8787 }
8888}
8989
@@ -198,21 +198,21 @@ static class MainButtonsRootDoButtonsPatch
198198 private static bool ReplaceOriginalDrawing ( MainButtonsRoot __instance )
199199 {
200200 if ( ! IsSpectator )
201- return true ;
201+ return true ;
202202
203203 try
204204 {
205205 var allButtons = AllButtonsRef ( __instance ) ;
206206 if ( allButtons == null )
207- return true ;
207+ return true ;
208208
209209 var toDraw = SpectatorButtons
210210 . Select ( name => allButtons . Find ( b => b . defName == name ) )
211211 . Where ( b => b ? . Worker . Visible ?? false )
212212 . ToList ( ) ;
213213
214214 DrawCornerButtons ( toDraw ) ;
215- return false ;
215+ return false ;
216216 }
217217 catch ( Exception ex )
218218 {
@@ -421,7 +421,7 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
421421 {
422422 yield return inst ;
423423
424- if ( inst . operand == playerFactionField )
424+ if ( inst . operand as MethodInfo == playerFactionField )
425425 yield return new CodeInstruction ( OpCodes . Call , factionOfPlayer . Method ) ;
426426 }
427427 }
@@ -442,7 +442,7 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
442442
443443 foreach ( var inst in insts )
444444 {
445- if ( inst . operand == isPlayerMethodGetter )
445+ if ( inst . operand as MethodInfo == isPlayerMethodGetter )
446446 inst . operand = factionIsPlayer . Method ;
447447
448448 yield return inst ;
@@ -464,7 +464,7 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
464464 {
465465 foreach ( var inst in insts )
466466 {
467- if ( inst . operand == allColonists )
467+ if ( inst . operand as MethodInfo == allColonists )
468468 inst . operand = AccessTools . Method ( typeof ( RecacheColonistBelieverCountPatch ) , nameof ( ColonistsAllPlayerFactions ) ) ;
469469 yield return inst ;
470470 }
@@ -516,7 +516,7 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
516516 {
517517 foreach ( var inst in insts )
518518 {
519- if ( inst . operand == isColonyMech )
519+ if ( inst . operand as MethodInfo == isColonyMech )
520520 inst . operand = AccessTools . Method ( typeof ( RecacheColonistBelieverCountPatch ) , nameof ( RecacheColonistBelieverCountPatch . IsColonyMechAnyFaction ) ) ;
521521
522522 yield return inst ;
@@ -557,10 +557,10 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
557557 {
558558 foreach ( var inst in insts )
559559 {
560- if ( inst . operand == isColonist )
560+ if ( inst . operand as MethodInfo == isColonist )
561561 inst . operand = AccessTools . Method ( typeof ( RecacheColonistBelieverCountPatch ) , nameof ( RecacheColonistBelieverCountPatch . IsColonistAnyFaction ) ) ;
562562
563- if ( inst . operand == isColonySubhuman )
563+ if ( inst . operand as MethodInfo == isColonySubhuman )
564564 inst . operand = AccessTools . Method ( typeof ( RecacheColonistBelieverCountPatch ) , nameof ( RecacheColonistBelieverCountPatch . IsColonySubhumanAnyFaction ) ) ;
565565
566566 yield return inst ;
@@ -577,7 +577,7 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
577577 {
578578 foreach ( var inst in insts )
579579 {
580- if ( inst . operand == isFreeNonSlaveColonist )
580+ if ( inst . operand as MethodInfo == isFreeNonSlaveColonist )
581581 inst . operand = AccessTools . Method ( typeof ( ValidatePawnPatch ) , nameof ( IsFreeNonSlaveColonistAnyFaction ) ) ;
582582
583583 yield return inst ;
@@ -632,7 +632,7 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
632632 {
633633 foreach ( var inst in insts )
634634 {
635- if ( inst . operand == PlayOneShotOnCamera )
635+ if ( inst . operand as MethodInfo == PlayOneShotOnCamera )
636636 yield return new CodeInstruction (
637637 OpCodes . Call ,
638638 SymbolExtensions . GetMethodInfo ( ( SoundDef s , Map m ) => PlaySoundReplacement ( s , m ) ) ) ;
@@ -661,7 +661,7 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
661661
662662 // This instruction is part of wornGraphicPaths[thingIDNumber % wornGraphicPaths.Count]
663663 // The function makes sure the id is positive
664- if ( inst . operand == thingIDNumberField )
664+ if ( inst . operand as MethodInfo == thingIDNumberField )
665665 yield return new CodeInstruction ( OpCodes . Call ,
666666 AccessTools . Method ( typeof ( ApparelWornGraphicPathGetterPatch ) , nameof ( MakeIdPositive ) ) ) ;
667667 }
@@ -721,7 +721,7 @@ static IEnumerable<CodeInstruction> Transpiler(IEnumerable<CodeInstruction> inst
721721 yield return inst ;
722722
723723 // Don't draw the ideo plate while choosing starting pawns in multifaction
724- if ( inst . operand == classicModeField )
724+ if ( inst . operand as MethodInfo == classicModeField )
725725 {
726726 yield return new CodeInstruction ( OpCodes . Ldarg_2 ) ;
727727 yield return new CodeInstruction ( OpCodes . Call ,
0 commit comments