private static void TestForceDownedx100() { int num = 0; Pawn pawn; while (true) { if (num < 100) { PawnKindDef random = DefDatabase <PawnKindDef> .GetRandom(); pawn = PawnGenerator.GeneratePawn(random, FactionUtility.DefaultFactionFrom(random.defaultFactionType)); GenSpawn.Spawn(pawn, CellFinderLoose.RandomCellWith((IntVec3 c) => c.Standable(Find.CurrentMap), Find.CurrentMap), Find.CurrentMap); HealthUtility.DamageUntilDowned(pawn); if (pawn.Dead) { break; } num++; continue; } return; } Log.Error("Pawn died while force downing: " + pawn + " at " + pawn.Position); }
private static void TestForceDownedx100() { for (int i = 0; i < 100; i++) { PawnKindDef random = DefDatabase <PawnKindDef> .GetRandom(); Pawn pawn = PawnGenerator.GeneratePawn(random, FactionUtility.DefaultFactionFrom(random.defaultFactionType)); GenSpawn.Spawn(pawn, CellFinderLoose.RandomCellWith((IntVec3 c) => c.Standable(Find.CurrentMap), Find.CurrentMap), Find.CurrentMap); HealthUtility.DamageUntilDowned(pawn); if (pawn.Dead) { Log.Error(string.Concat("Pawn died while force downing: ", pawn, " at ", pawn.Position)); break; } } }