private static void LogCouldNotReserveError(ReservationManager __instance, Pawn claimant, Job job, LocalTargetInfo target, int maxPawns, int stackCount, ReservationLayerDef layer) { Job curJob1 = claimant.CurJob; string str1 = "null"; int num1 = -1; if (curJob1 != null) { str1 = curJob1.ToString(); if (claimant.jobs.curDriver != null) { num1 = claimant.jobs.curDriver.CurToilIndex; } } string str2 = !target.HasThing || target.Thing.def.stackLimit == 1 ? "" : "(current stack count: " + (object)target.Thing.stackCount + ")"; string str3 = "Could not reserve " + target.ToStringSafe <LocalTargetInfo>() + str2 + " (layer: " + layer.ToStringSafe <ReservationLayerDef>() + ") for " + claimant.ToStringSafe <Pawn>() + " for job " + job.ToStringSafe <Job>() + " (now doing job " + str1 + "(curToil=" + (object)num1 + ")) for maxPawns " + (object)maxPawns + " and stackCount " + (object)stackCount + "."; Pawn pawn1 = __instance.FirstRespectedReserver(target, claimant); string text; if (pawn1 != null) { string str4 = "null"; int num2 = -1; Job curJob2 = pawn1.CurJob; if (curJob2 != null) { str4 = curJob2.ToStringSafe <Job>(); if (pawn1.jobs.curDriver != null) { num2 = pawn1.jobs.curDriver.CurToilIndex; } } text = str3 + " Existing reserver: " + pawn1.ToStringSafe <Pawn>() + " doing job " + str4 + " (toilIndex=" + (object)num2 + ")"; } else { text = str3 + " No existing reserver."; } Pawn pawn2 = map(__instance).physicalInteractionReservationManager.FirstReserverOf(target); if (pawn2 != null) { text = text + " Physical interaction reserver: " + pawn2.ToStringSafe <Pawn>(); } Log.Error(text, false); }
public static bool Prefix(ReservationManager __instance, Pawn claimant, LocalTargetInfo target) { return(false); if (claimant.IsGuest()) { return(false); } Pawn pawn = __instance.FirstRespectedReserver(target, claimant); if (pawn.IsGuest()) { return(false); } return(true); }