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

View File

@ -30,7 +30,7 @@ namespace RJW_Menstruation
var pawnparts = Genital_Helper.get_PartsHediffList(pawn, Genital_Helper.get_genitalsBPR(pawn));
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))
{
@ -237,7 +237,7 @@ namespace RJW_Menstruation
foreach(CodeInstruction instruction in instructions)
{
// 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
pawn_index = (LocalBuilder)instruction.operand;
yield return instruction;