Skip to content

Commit

Permalink
removes a work request bug
Browse files Browse the repository at this point in the history
  • Loading branch information
pardeike committed Sep 9, 2023
1 parent 1eb43a4 commit 41b6de5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Binary file modified 1.4/Assemblies/AchtungMod.dll
Binary file not shown.
7 changes: 5 additions & 2 deletions Source/ForcedExtensions.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
using System.Linq;
using Verse.AI;
using Verse;
using UnityEngine.VR;

namespace AchtungMod
{
Expand Down Expand Up @@ -54,11 +55,13 @@ public static Job GetThingJob(this Thing thing, Pawn pawn, WorkGiver_Scanner sca
{
if (thing == null || thing.Spawned == false)
return null;
var potentialWork = scanner.PotentialWorkThingRequest.Accepts(thing);
var request = scanner.PotentialWorkThingRequest;
var potentialWork = request.IsUndefined == false && request.Accepts(thing);
if (potentialWork == false)
{
var workThingsGlobal = scanner.PotentialWorkThingsGlobal(pawn);
workThingsGlobal ??= pawn.Map.listerThings.ThingsMatching(scanner.PotentialWorkThingRequest);
if (request.IsUndefined == false)
workThingsGlobal ??= pawn.Map.listerThings.ThingsMatching(request);
if (workThingsGlobal != null && workThingsGlobal.Contains(thing))
potentialWork = true;
}
Expand Down

0 comments on commit 41b6de5

Please sign in to comment.