Skip to content

Round of fixes for jbwapi - #102

Merged
JasperGeurtz merged 9 commits into
developfrom
all-cgpt-fixes
Nov 7, 2026
Merged

JasperGeurtz merged 9 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!

JasperGeurtz pushed a commit that referenced this pull request Nov 7, 2026
… PR #102 fixes

# Conflicts:
#	src/test/java/bwapi/GameTest.java
JasperGeurtz pushed a commit that referenced this pull request Nov 7, 2026
… PR #102 fixes

# Conflicts:
#	src/test/java/bwapi/GameTest.java
… PR #102 fixes

# Conflicts:
#	src/test/java/bwapi/GameTest.java
@JasperGeurtz
JasperGeurtz merged commit 858048c into develop Nov 7, 2026
11 checks passed
@JasperGeurtz
JasperGeurtz deleted the all-cgpt-fixes branch November 8, 2026 18:24
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