public static Pawn GetOwnerOf(Caravan caravan, Thing item) { IThingHolder parentHolder = item.ParentHolder; if (parentHolder is Pawn_InventoryTracker) { Pawn pawn = (Pawn)parentHolder.ParentHolder; if (caravan.ContainsPawn(pawn)) { return(pawn); } } return(null); }