Skip to content

Fix X-Ray for multi-hex movement previews#3172

Open
emptyteabot wants to merge 1 commit into
FreezingMoon:masterfrom
emptyteabot:fix-xray-above-footprint
Open

Fix X-Ray for multi-hex movement previews#3172
emptyteabot wants to merge 1 commit into
FreezingMoon:masterfrom
emptyteabot:fix-xray-above-footprint

Conversation

@emptyteabot
Copy link
Copy Markdown

Summary

  • add a shared helper that computes the full hex footprint for hovered move/target previews
  • pass that full footprint into X-Ray so medium and large units ghost blockers for every occupied preview hex, not only the cursor hex
  • keep the last footprint available for X-Ray reapply paths and clear it at turn-boundary cleanup

Testing

  • npx eslint src/utility/query_footprint.ts src/utility/hexgrid.ts src/tests/utility/query_footprint.ts src/tests/utility/hexgrid-xray.ts
  • npx jest src/tests/utility/query_footprint.ts src/tests/utility/hexgrid-xray.ts --runInBand
  • npx tsc --noEmit
  • npm run build
  • npx jest --runInBand

/claim #1301

Payout note: if this bounty can be paid as an EVM stablecoin instead of XTR, wallet is 0xe2e86bdb8753c24032f2ad42b4c1bd9748385a7d.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 13, 2026

@emptyteabot is attempting to deploy a commit to the FreezingMoon Team on Vercel.

A member of the Team first needs to authorize it.

@emptyteabot emptyteabot force-pushed the fix-xray-above-footprint branch from 79c0146 to 3473264 Compare May 13, 2026 14:12
@emptyteabot
Copy link
Copy Markdown
Author

Ready for review. The failing Vercel status is a team authorization block for the preview deployment, not a build/runtime failure from this PR. Local verification was completed before submission.

@vercel
Copy link
Copy Markdown

vercel Bot commented May 14, 2026

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

Project Deployment Actions Updated (UTC)
ancientbeast Ready Ready Preview May 14, 2026 11:03am

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR improves X-Ray behavior during hovered movement/target previews for medium/large creatures by computing the full multi-hex preview footprint and applying X-Ray across every hex in that footprint (instead of only the cursor hex), while also preserving the last computed footprint for X-Ray reapply flows.

Changes:

  • Added getQueryFootprintHexes() helper to compute the full multi-hex footprint for hovered previews (including flipped-player offset and walkability adjustment).
  • Updated HexGrid.queryHexes() hover path to pass the computed footprint into HexGrid.xray() so X-Ray ghosts blockers for all occupied preview hexes.
  • Extended HexGrid.xray() to accept an optional footprint, cache/reuse it for reapply paths, and clear it during clearAllXray(), with added Jest coverage for the new behavior.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
src/utility/query_footprint.ts Adds a shared helper to compute the occupied hex footprint for hovered multi-hex previews.
src/utility/hexgrid.ts Threads preview footprint into X-Ray, caches it for reapply, and clears it at turn-boundary cleanup.
src/__tests__/utility/query_footprint.ts Adds unit tests validating footprint computation for flipped/non-flipped multi-hex previews.
src/__tests__/utility/hexgrid-xray.ts Adds a unit test ensuring X-Ray applies ghostOverlap() for every hex in the preview footprint.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

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.

2 participants