Replace a bunch of "is null" with "== null"

This commit is contained in:
lutepickle 2022-07-11 07:27:23 -07:00
parent 1133255b0a
commit afc04d2fa5
2 changed files with 5 additions and 5 deletions

View file

@ -1059,8 +1059,8 @@ namespace RJW_Menstruation
{ {
if (Props.breedingSeason == SeasonalBreed.Always) return true; if (Props.breedingSeason == SeasonalBreed.Always) return true;
Map map = parent.pawn.Map; Map map = parent.pawn.Map;
if (map is null) map = Find.AnyPlayerHomeMap; if (map == null) map = Find.AnyPlayerHomeMap;
if (map is null) return true; if (map == null) return true;
switch (GenLocalDate.Season(map)) switch (GenLocalDate.Season(map))
{ {
case Season.Spring: case Season.Spring:
@ -1130,7 +1130,7 @@ namespace RJW_Menstruation
egg.fertstage < minImplantAgeHours || egg.fertstage < minImplantAgeHours ||
egg.position < Math.Min(Props.lutealIntervalDays / 2, maxImplantDelayDays) * 24) egg.position < Math.Min(Props.lutealIntervalDays / 2, maxImplantDelayDays) * 24)
continue; continue;
else if (egg.fertilizer is null) else if (egg.fertilizer == null)
{ {
deadeggs.Add(egg); deadeggs.Add(egg);
continue; continue;

View file

@ -30,7 +30,7 @@ namespace RJW_Menstruation
var pawnparts = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn)); var pawnparts = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn));
HediffComp_Menstruation comp = partner.GetMenstruationComp(); HediffComp_Menstruation comp = partner.GetMenstruationComp();
if (comp is null) return true; if (comp == null) return true;
if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype)) if (Genital_Helper.has_penis_fertile(pawn, pawnparts) && PregnancyHelper.CanImpregnate(pawn, partner, sextype))
{ {
@ -237,7 +237,7 @@ namespace RJW_Menstruation
foreach(CodeInstruction instruction in instructions) foreach(CodeInstruction instruction in instructions)
{ {
// Get where the compiler decided to index the pawn at // Get where the compiler decided to index the pawn at
if (pawn_index is null && instruction.opcode == OpCodes.Stloc_S) // the first stloc.s in the IL is the pawn being loaded out of the list if (pawn_index == null && instruction.opcode == OpCodes.Stloc_S) // the first stloc.s in the IL is the pawn being loaded out of the list
{ // a future RJW or compiler update might change this, or maybe another mod's patch { // a future RJW or compiler update might change this, or maybe another mod's patch
pawn_index = (LocalBuilder)instruction.operand; pawn_index = (LocalBuilder)instruction.operand;
yield return instruction; yield return instruction;