Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#577 added check if cells are blocked #582

Merged
merged 1 commit into from
May 15, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Languages/English/Keyed/AllKeyed_SAL3.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,7 @@
<SmartHopper_Minimum_UseTooltip>When this is enabled, the smart hopper will unforbid its items if the stored item has less than X stack size. It will also only take items if there are enough items around to exceed the minimum.</SmartHopper_Minimum_UseTooltip>
<SmartHopper_Maximum_UseTooltip>When this is enabled, the smart hopper will stop taking items if either the stack is full, or the stack size exceeds or is equal to X.</SmartHopper_Maximum_UseTooltip>
<SmartHopper_PickupFromGround>Pickup from ground</SmartHopper_PickupFromGround>
<PRF_CantCreateStockpile>Can't create Stockpile (No free Cells).</PRF_CantCreateStockpile>

<!--Mod settings-->
<ProjectRimFactoryModName>Project RimFactory</ProjectRimFactoryModName>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -178,8 +178,16 @@ public override IEnumerable<Gizmo> GetGizmos()

private void MakeMatchingStockpileZone()
{
Designator_ZoneAddStockpile_Resources stockpileZone = new Designator_ZoneAddStockpile_Resources();
stockpileZone.DesignateMultiCell(IngredientStackCells.Where(c => c != OutputComp.CurrentCell));
var stockpileCells = IngredientStackCells.Where(c => c != OutputComp.CurrentCell && !this.Map.thingGrid.ThingsListAt(c).Any(t => !t.def.CanOverlapZones));
if (stockpileCells.Count() > 0)
{
Designator_ZoneAddStockpile_Resources stockpileZone = new Designator_ZoneAddStockpile_Resources();
stockpileZone.DesignateMultiCell(stockpileCells);
}
else
{
Messages.Message("PRF_CantCreateStockpile".Translate(), this, MessageTypeDefOf.CautionInput);
}
}


Expand Down