private void TryPickupFilth() { TerrainDef terrDef = pawn.Map.terrainGrid.TerrainAt(pawn.Position); if (terrDef.generatedFilth != null) { for (int num = carriedFilth.Count - 1; num >= 0; num--) { if (carriedFilth[num].def.filth.terrainSourced && carriedFilth[num].def != terrDef.generatedFilth) { ThinCarriedFilth(carriedFilth[num]); } } Filth filth = (from f in carriedFilth where f.def == terrDef.generatedFilth select f).FirstOrDefault(); if (filth == null || filth.thickness < 1) { GainFilth(terrDef.generatedFilth); FilthMonitor.Notify_FilthAccumulated(); } } List <Thing> thingList = pawn.Position.GetThingList(pawn.Map); for (int num2 = thingList.Count - 1; num2 >= 0; num2--) { Filth filth2 = thingList[num2] as Filth; if (filth2 != null && filth2.CanFilthAttachNow) { GainFilth(filth2.def, filth2.sources); filth2.ThinFilth(); } } }
private void TryPickupFilth() { TerrainDef terrDef = this.pawn.Map.terrainGrid.TerrainAt(this.pawn.Position); if (terrDef.generatedFilth != null) { for (int i = this.carriedFilth.Count - 1; i >= 0; i--) { if (this.carriedFilth[i].def.filth.terrainSourced && this.carriedFilth[i].def != terrDef.generatedFilth) { this.ThinCarriedFilth(this.carriedFilth[i]); } } Filth filth = (from f in this.carriedFilth where f.def == terrDef.generatedFilth select f).FirstOrDefault <Filth>(); if (filth == null || filth.thickness < 1) { this.GainFilth(terrDef.generatedFilth); FilthMonitor.Notify_FilthAccumulated(); } } List <Thing> thingList = this.pawn.Position.GetThingList(this.pawn.Map); for (int j = thingList.Count - 1; j >= 0; j--) { Filth filth2 = thingList[j] as Filth; if (filth2 != null && filth2.CanFilthAttachNow) { this.GainFilth(filth2.def, filth2.sources); filth2.ThinFilth(); } } }