Repository navigation
Round of fixes for jbwapi (2) - #107
Merged
Merged
Conversation
JasperGeurtz
force-pushed
the
bwapi-4.4.0-fixes
branch
2 times, most recently
from
November 7, 2026 19:38
94aec78 to
080fe7d
Compare
- CommandTemp: subtract gas cost on Upgrade; fix Cancel_Train_Slot queue shift OOB - Unit: fix canBuildAddon(UnitType) overload call, canAttackGrouped(Position) check, isTargetable visibility check, canTargetUnit(Unit) default checkCommandibility, isVisible replay fallback/bounds check, and build/train/useTech special-case redirects - Bullet: fix isVisible replay fallback and player ID bounds check - Player: fix isEnemy/isNeutral delegation to PlayerData and supplyTotal/supplyUsed Race.None and bounds checks - Region: fix updateNeighbours accessibility check to compare regionGroupID - Game: refresh allies/enemies/observers each frame and fix drawEllipseScreen coordinate type - BuildingPlacer: avoid mutating original PlacementReserve in ReserveDefault - UnitCommand: include Repair in isQueued - Add unit tests for all BWAPI 4.4.0 alignment fixes
JasperGeurtz
force-pushed
the
bwapi-4.4.0-fixes
branch
from
November 8, 2026 09:19
080fe7d to
bfb33aa
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes discrepancies in jbwapi found by Gemini
CommandTemp:Upgradecommands.ArrayIndexOutOfBoundsExceptioninCancel_Train_Slotwhen shifting a full 5-slot training queue, and useUnit.getTrainingQueueAt.Unit:canBuildAddon(UnitType)callingcanBuildAddon(type, false)instead ofcanBuildAddon(false)before checkingcanMake(type, this).canAttackGrouped(Position, ...)checkingcanAttackUnitGroupedinstead of onlycanAttackMoveGrouped.isTargetable()to requireisVisible(game.self())whenCompleteMapInformationis disabled.canTargetUnit(Unit)to passcheckCommandibility = trueby default (matching C++ BWAPIcanTargetUnit(targetUnit, true)).isVisible()to fall back to checking visibility for any player (0..8) whengame.self() == null(e.g. in replays) and validate player ID bounds (0..11).build(type, TilePosition.None)(trains Carrier/Reaver ammo),train(UnitType.None)(cancels morph/construction/addon), anduseTech(tech, null)(redirects to targetlessuseTech(tech)).Bullet:isVisible()to fall back to checking visibility for any player (0..8) whengame.self() == nulland validate player ID bounds (0..11).Player:isEnemy(Player)to delegate toplayerData.isEnemy(player.getID())instead of!playerData.isAlly(...).isNeutral()to delegate toplayerData.isNeutral()instead of comparingequals(game.neutral()).supplyTotal()andsupplyUsed()to sum across Zerg/Terran/Protoss (0..2), defaultRace.NonetogetRace(), and return0for invalid races (Race.Unknown).Region:updateNeighbours()accessibility check to comparegetRegionGroupID() == neighbor.getRegionGroupID()instead ofisHigherGround().Game:allies(),enemies(), andobservers()on every frame (excluding defeated/left players) instead of only at game start.drawEllipseScreenpassingCoordinateType.Mouseinstead ofCoordinateType.Screen.BuildingPlacer:PlacementReservebefore clearing unwalkable tiles inReserveDefaultinstead of mutating the shared static array in place.UnitCommand:UnitCommandType.RepairinisQueued().