Skip to content
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 C7/UIElements/UnitButtons/UnitButtons.cs
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,7 @@ private void OnUnitMoved(ParameterWrapper<MapUnit> wrappedMapUnit) {
}

private void UpdateButtons(MapUnit unit) {
if (!unit.CanBeActive()) return;
// Reset the visibility and tooltip whenever the unit changes.
foreach (ButtonAndTooltip btt in buttonMap.Values) {
btt.button.Visible = false;
Expand Down
4 changes: 1 addition & 3 deletions C7Engine/C7GameData/Tile.cs
Original file line number Diff line number Diff line change
Expand Up @@ -773,9 +773,7 @@ public TerrainImprovement ImprovementAtLayer(TerrainImprovement.Layer layer) {
}

public TerrainImprovement ImprovementAtLayer(Terraform terraform) {
TerrainImprovement.Layer currentLayer = terraform.Improvement.layer;
terrainImprovementByLayer.TryGetValue(currentLayer, out TerrainImprovement ti);
return ti;
return terraform.Improvement == null ? null : ImprovementAtLayer(terraform.Improvement.layer);
}

public bool HasImprovement(TerrainImprovement improvement) {
Expand Down