getBattlefieldIdByBit is being passed a mask instead of a single battlefield bit, which is then being passed into battlefieldAtCapacity. This fix moves battlefieldAtCapacity to the correct place in findBattlefields and each battlefield is checked individually.
getBattlefieldIdByBit is being passed a mask instead of a single battlefield bit, which is then being passed into battlefieldAtCapacity. This fix moves battlefieldAtCapacity to the correct place in findBattlefields and each battlefield is checked individually.