Skip to content

Round of fixes for jbwapi - #102

Open
JasperGeurtz wants to merge 8 commits into
developfrom
all-cgpt-fixes
Open

JasperGeurtz wants to merge 8 commits into
developfrom
all-cgpt-fixes

Conversation

@JasperGeurtz

@JasperGeurtz JasperGeurtz commented Oct 31, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

This PR fixes several behavioral discrepancies and bugs in JBWAPI, found using ChatGPT.

Changes

  • BuildingPlacer

    • Fix the starting position calculation when reserving existing addon placement locations.
    • Correct structure reservation padding for factories, missile turrets, robotics facilities, gateways, and photon cannons.
  • Game

    • Fix getUnitsOnTile() to return units whose bounding boxes intersect the specified tile, rather than only units whose top-left tile matches it.
    • Fix getUnitsInRadius() to use unit-to-position distance instead of approximate center-to-center distance.
    • Handle empty map filenames safely in setMap().
  • Player

    • Correct the purple text color comment and fix the green color mapping.
  • Unit

    • Correct the weapon target filtering logic in getUnitsInWeaponRange().
    • Fix the path check in canGather() to check the target unit's position.
    • Fix the enemy-player comparison in the healing tech check in canUseTechUnit().
  • UnitFilter

    • Introduce the correctly spelled IsTransport filter while retaining IsTransPort as a deprecated alias for backward compatibility.

@dgant

dgant commented Nov 2, 2026

Copy link
Copy Markdown
Contributor

Looks good!

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants