Skip to content

fix(render): defense post rendering - #6436

Open
cosyntxd wants to merge 1 commit into
openfrontio:mainfrom
cosyntxd:defense-post-rendering
Open

cosyntxd wants to merge 1 commit into
openfrontio:mainfrom
cosyntxd:defense-post-rendering

Conversation

@cosyntxd

Copy link
Copy Markdown
Contributor

when a player loses their defense post, the shaded region may still be rendered until the building is fully removed.

Resolves #6329. Unable to reproduce the issue with this patch.

Syntxd

when a play loses their defense post, the shaded region may still be rendered until the building is fully removed.
@github-actions

Copy link
Copy Markdown
Contributor

Thanks for the PR, @cosyntxd!

When it's ready for a maintainer to review, comment /ready. That adds the ready-for-review label, which is how we find PRs waiting on us. Until then we assume you're still working on it.

  • Draft PRs can't be marked ready. Click Ready for review on the PR first, then comment /ready.
  • If we request changes, the label comes off. Push your fixes, then comment /ready again so we know to take another look. Pushing alone doesn't put it back in the queue.
  • Comment /unready to take it out of the queue yourself.

See CONTRIBUTING.md for the full process.

@coderabbitai

coderabbitai Bot commented Nov 15, 2026 •

Copy link
Copy Markdown
Contributor

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

GPURenderer.updateStructures now adds a Defense Post to the coverage-pass input only when the post is active and not under construction.

Changes

Defense Post Coverage

Layer / File(s) Summary
Filter Defense Posts
src/client/render/gl/Renderer.ts
updateStructures excludes inactive Defense Posts, as well as posts under construction, from the coverage-pass input.

Estimated code review effort: 1 (Trivial) | ~3 minutes

Change: Bug fix · Severity of issue fixed: Low

Suggested reviewers: evanpelle

Merge Risk: Minimal · up to aabae

The fix stops stale defense-post shading from remaining after a post becomes inactive. It is a small, localized rendering change and no merge-blocking risk was found.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the changed area (defense post rendering) and the fix type, which matches the single-line change in GPURenderer.updateStructures that filters Defense Posts by active state in the cover…
Description check Passed The description states the bug (shaded region rendered after a player loses a defense post) and links issue #6329. It relates directly to the changeset, so it passes even though it is brief and includ…
Linked Issues check Passed Issue #6329 requires that a Defense Post shaded region not render when no Defense Post is present. The reviewed diff changes GPURenderer.updateStructures in src/client/render/gl/Renderer.ts (line …
Out of Scope Changes check Passed The whole-PR diff against the merge base changes one line in src/client/render/gl/Renderer.ts. The added u.isActive condition is the only change. It directly targets the Defense Post shaded-region…
Full details: Title check

Explanation

The title names the changed area (defense post rendering) and the fix type, which matches the single-line change in GPURenderer.updateStructures that filters Defense Posts by active state in the coverage-pass input. It is short and specific, so it passes.

Full details: Description check

Explanation

The description states the bug (shaded region rendered after a player loses a defense post) and links issue #6329. It relates directly to the changeset, so it passes even though it is brief and includes a note that the issue could not be reproduced.

Full details: Linked Issues check

Explanation

Issue #6329 requires that a Defense Post shaded region not render when no Defense Post is present. The reviewed diff changes GPURenderer.updateStructures in src/client/render/gl/Renderer.ts (line 960). A Defense Post now enters the coverage-pass posts list only when !u.underConstruction && u.isActive. Before this change, any Defense Post not under construction entered the list, including a post that was destroyed or otherwise inactive but still present in units. The filter removes that case from the coverage input, which addresses the reported symptom. Limits: the diff does not show the definition of isActive, and the PR adds no automated test. The meaning of isActive on destruction is inferred from its name. The author reports the issue no longer reproduces, but this is not independently verified here.

Full details: Out of Scope Changes check

Explanation

The whole-PR diff against the merge base changes one line in src/client/render/gl/Renderer.ts. The added u.isActive condition is the only change. It directly targets the Defense Post shaded-region rendering described in #6329. No unrelated changes appear in the diff.

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Active posts shade the land
Inactive posts leave no trace
Building posts wait their turn
Coverage follows the state
One small check clears the view

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ee96d59d-eef2-4fb8-802b-30470b571d44
Commits

Reviewing files that changed from the base of the PR and between 4457217 and aabae1a.

Files selected for processing: 1

  • src/client/render/gl/Renderer.ts

Included review availability: This review used your included allowance. Your plan provides up to 8 included reviews per hour; 7 remain after this review.

@cosyntxd

Copy link
Copy Markdown
Contributor Author

/ready

@github-actions

Copy link
Copy Markdown
Contributor

🤖 Claude Code Review

Verdict: No issues found. Findings: 0 critical, 0 major, 0 minor.

Checked for bugs and CLAUDE.md compliance. Adding u.isActive to the defense-post filter in src/client/render/gl/Renderer.ts follows the documented contract on GameView.unitStates() ("Includes inactive units; renderer filters by state.isActive"). The other structure passes already filter this way. GameView marks structures dirty on the tick a post becomes inactive, so the coverage overlay is rebuilt without the dead post. A captured post stays active, so its shading is still drawn.

@Celant Celant left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Traced it through and this is the right fix. GameView only sets structuresDirty on the tick the post flips inactive, while it is still in the units map; the next tick drops it from the map without dirtying again, so that one upload was the only chance to clear the circle and it was still pushing the dead post. Every other structure pass already filters on isActive, so this brings the coverage pass in line. Looks good to me.

@Celant Celant added this to the v37 milestone Nov 15, 2026
@github-project-automation github-project-automation Bot moved this from Triage to Final Review in OpenFront Release Management Nov 15, 2026

This branch has not been deployed

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

Projects

Status: Final Review

Development

Successfully merging this pull request may close these issues.

Defense post rendering when destroyed

2 participants