Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Source/Client/AsyncTime/AsyncWorldTimeComp.cs
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ public TimeSpeed DesiredTimeSpeed
get => !Find.Maps.Any()
? timeSpeedInt
: Find.Maps.Select(m => m.AsyncTime())
.Where(a => a.ActualRateMultiplier(a.DesiredTimeSpeed) != 0f)
.Where(a => a != null && a.ActualRateMultiplier(a.DesiredTimeSpeed) != 0f)
.Max(a => a?.DesiredTimeSpeed) ?? TimeSpeed.Paused;
set => timeSpeedInt = value;
}
Expand Down
2 changes: 1 addition & 1 deletion Source/Client/Factions/Forbiddables.cs
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ static class ThingDespawnUnsetForbidden
static void Prefix(Thing __instance)
{
if (Multiplayer.Client == null) return;
__instance.Map.MpComp().Notify_ThingDespawned(__instance);
__instance.Map?.MpComp()?.Notify_ThingDespawned(__instance);

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel this can't ever be null. Did you get errors somewhere?

}
}
}
2 changes: 1 addition & 1 deletion Source/Client/Patches/TeachingPatches.cs
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ static bool Prefix(Thing t, ref Job __result)
if (!Multiplayer.InInterface)
return true;
// If target is not pawn, no result
if (t is not Pawn pawn)
if (t is not Pawn pawn || pawn.CurJob == null)
return false;

// Alternative approach would be to store the current target of the lesson taking pawn in the
Expand Down
Loading