Skip to content
Open
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
6 changes: 4 additions & 2 deletions src/lib/simulation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1985,8 +1985,10 @@ function generateAdvisorMessages(stats: Stats, services: ServiceCoverage, grid:

for (const row of grid) {
for (const tile of row) {
// Only count zoned buildings (not grass)
if (tile.zone !== 'none' && tile.building.type !== 'grass') {
// 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

if (!tile.building.powered) unpoweredBuildings++;
if (!tile.building.watered) unwateredBuildings++;
}
Expand Down