Skip to content

Fix false power/water warnings for non-building tiles#421

Open
amilich wants to merge 1 commit intomainfrom
daybreak-hue/fix-false-power-warning
Open

Fix false power/water warnings for non-building tiles#421
amilich wants to merge 1 commit intomainfrom
daybreak-hue/fix-false-power-warning

Conversation

@amilich
Copy link
Copy Markdown
Owner

@amilich amilich commented Feb 9, 2026

Improved the advisor message filtering to exclude terrain and infrastructure tiles (water, road, bridge, empty) when counting unpowered and unwatered buildings. This prevents false warnings about missing power or water for tiles that don't represent actual buildings.

Changes made:

  • Extended the building type filter to exclude water, road, bridge, and empty tiles
  • Improved comments to clarify what tiles are being excluded
  • Minor optimization by caching the building type in a variable

🤖 Generated with Claude Code


Note

Low Risk
Small change to advisor message counting logic only; low risk aside from potentially changing when utility warnings appear.

Overview
Fixes false Power/Water advisor warnings by tightening the generateAdvisorMessages counters to only include actual zoned buildings and exclude non-building tile types (water, road, bridge, empty, in addition to grass).

Also does a tiny micro-optimization by caching tile.building.type into btype while scanning the grid.

Written by Cursor Bugbot for commit 91e4d0a. This will update automatically on new commits. Configure here.

Cursor Bugbot found 1 potential issue for commit 91e4d0a
Open with Devin

Improved filtering to exclude terrain and infrastructure (water, road, bridge, empty) when counting unpowered and unwatered buildings, fixing false warnings about missing power/water.

Co-Authored-By: Claude Haiku 4.5 <noreply@anthropic.com>
@assert-app
Copy link
Copy Markdown

assert-app bot commented Feb 9, 2026

Your pull request is now ready for review with Assert.

Open Review →


Stop waiting for your code to break. Ship with confidence using Assert.

@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Feb 9, 2026

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
isometric-city Ready Ready Preview, Comment Feb 9, 2026 11:26pm

Request Review

Copy link
Copy Markdown

@cursor cursor bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cursor Bugbot has reviewed your changes and found 1 potential issue.

Comment thread src/lib/simulation.ts
// Only count actual zoned buildings (exclude terrain, infrastructure, and placeholders)
const btype = tile.building.type;
if (tile.zone !== 'none' && btype !== 'grass' && btype !== 'water' &&
btype !== 'road' && btype !== 'bridge' && btype !== 'empty') {
Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Missing tree in non-building type exclusion filter

Medium Severity · Logic Bug

The filter excludes grass, water, road, bridge, and empty from unpowered/unwatered counts, but misses tree. Zoning can be applied to tree tiles (see allowedTypesForZoning which includes 'tree'), so zoned tree tiles will have powered: false and watered: false and be incorrectly counted as unpowered/unwatered buildings. The NO_CONSTRUCTION_TYPES constant groups tree alongside all the other excluded types, confirming it belongs in this filter too.

Fix in Cursor Fix in Web

Copy link
Copy Markdown
Contributor

@devin-ai-integration devin-ai-integration bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 2 additional findings.

Open in Devin Review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant