public void Notify_PawnLost(Pawn pawn, PawnLostCondition cond, DamageInfo?dinfo = null) { if (ownedPawns.Contains(pawn)) { RemovePawn(pawn); if (cond == PawnLostCondition.IncappedOrKilled || cond == PawnLostCondition.MadePrisoner) { numPawnsLostViolently++; } curJob.Notify_PawnLost(pawn, cond); if (!lordManager.lords.Contains(this)) { return; } if (!ShouldExist) { Destroy(); return; } curLordToil.Notify_PawnLost(pawn, cond); TriggerSignal signal = default(TriggerSignal); signal.type = TriggerSignalType.PawnLost; signal.thing = pawn; signal.condition = cond; if (dinfo.HasValue) { signal.dinfo = dinfo.Value; } CheckTransitionOnSignal(signal); } else { Log.Error(string.Concat("Lord lost pawn ", pawn, " it didn't have. Condition=", cond)); } }
public void Notify_PawnLost(Pawn pawn, PawnLostCondition cond, DamageInfo?dinfo = default(DamageInfo?)) { if (ownedPawns.Contains(pawn)) { RemovePawn(pawn); if (cond == PawnLostCondition.IncappedOrKilled || cond == PawnLostCondition.MadePrisoner) { numPawnsLostViolently++; } curJob.Notify_PawnLost(pawn, cond); if (lordManager.lords.Contains(this)) { if (ownedPawns.Count == 0 && !CanExistWithoutPawns) { lordManager.RemoveLord(this); } else { curLordToil.Notify_PawnLost(pawn, cond); TriggerSignal signal = default(TriggerSignal); signal.type = TriggerSignalType.PawnLost; signal.thing = pawn; signal.condition = cond; if (dinfo.HasValue) { signal.dinfo = dinfo.Value; } CheckTransitionOnSignal(signal); } } } else { Log.Error("Lord lost pawn " + pawn + " it didn't have. Condition=" + cond); } }