From 07babdb04ad169def2560d413232b718d2cf9ca7 Mon Sep 17 00:00:00 2001 From: BlackJack1155 <99104742+BlackJack1155@users.noreply.github.com> Date: Mon, 28 Feb 2022 15:59:45 +0100 Subject: [PATCH 1/2] (Temporary) fix for pawns not performing surgery DoBillsMedicalHumanOperation and DoBillsMedicalAnimalOperation both fall under the ThingRequestGroup.PotentialBillGiver, but require a pawn to be added to the resulting "thing" variable. from what I was able to gather this is not handled by the GenClosest_Patch.ClosestThingRequestGroup. --- Source/JobGiver_Work_Patch.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Source/JobGiver_Work_Patch.cs b/Source/JobGiver_Work_Patch.cs index e34c189..8214999 100644 --- a/Source/JobGiver_Work_Patch.cs +++ b/Source/JobGiver_Work_Patch.cs @@ -150,7 +150,8 @@ public static bool TryIssueJobPackage(JobGiver_Work __instance, ref ThinkResult scanner.PotentialWorkThingRequest.group == ThingRequestGroup.Refuelable || scanner.PotentialWorkThingRequest.group == ThingRequestGroup.Transporter || scanner.PotentialWorkThingRequest.group == ThingRequestGroup.BuildingFrame || - scanner.PotentialWorkThingRequest.group == ThingRequestGroup.PotentialBillGiver || + //temp fix, will have to be revieved and reworked + (scanner.PotentialWorkThingRequest.group == ThingRequestGroup.PotentialBillGiver & !(workGiver.def.defName.Equals("DoBillsMedicalHumanOperation") || workGiver.def.defName.Equals("DoBillsMedicalAnimalOperation"))) scanner.PotentialWorkThingRequest.group == ThingRequestGroup.Filth //|| //scanner.PotentialWorkThingRequest.group == ThingRequestGroup.BuildingArtificial )) From 448351a76ff3e2ab333a92feb7de79fe409d2674 Mon Sep 17 00:00:00 2001 From: BlackJack1155 <99104742+BlackJack1155@users.noreply.github.com> Date: Thu, 3 Mar 2022 11:02:13 +0100 Subject: [PATCH 2/2] Fix spawning of structures and pawns on raids for initial map generation vanilla relies on the result of this method to not be null. During normal play this may be superfluous, here the region gets only rebuilt during initial initialisation. --- Source/RegionGrid_Patch.cs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/Source/RegionGrid_Patch.cs b/Source/RegionGrid_Patch.cs index 2fa11d3..69f4c68 100644 --- a/Source/RegionGrid_Patch.cs +++ b/Source/RegionGrid_Patch.cs @@ -56,15 +56,16 @@ public static bool GetValidRegionAt(RegionGrid __instance, ref Region __result, Log.Warning(string.Concat("Trying to get valid region at ", c, " but RegionAndRoomUpdater is disabled. The result may be incorrect.")); } Region region = __instance.regionGrid[map.cellIndices.CellToIndex(c)]; - if (region == null || !region.valid) + if (map.AgeInDays==0f&&(region == null || !region.valid)) { - /* + //not locking this breaks the generation of raid maps, since structure, pawn and loot generation depend on the canReachMapBorder or something in order to generate + //Log.Message("Intitially generating region for a map, namedly: " + map.uniqueID + " Dict :"+Regen); + lock (map.regionAndRoomUpdater) { regionAndRoomUpdater.TryRebuildDirtyRegionsAndRooms(); region = __instance.regionGrid[map.cellIndices.CellToIndex(c)]; } - */ } if (region != null && region.valid) {