Skip to content

Commit

Permalink
Only move supply units towards units with supply needs if it can actu…
Browse files Browse the repository at this point in the history
…ally supply them.

GitOrigin-RevId: df82eeba6ca00285091e931aae53bdbaac16f0a7
  • Loading branch information
cpojer committed Nov 1, 2024
1 parent 2a859fb commit 8472ad4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dionysus/lib/getInterestingVectors.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,11 @@ export default function getInterestingVectors(

if (info.hasAbility(Ability.Supply)) {
for (const [vector, unit] of map.units) {
if (map.matchesPlayer(unit, map.currentPlayer) && needsSupply(unit)) {
if (
map.matchesPlayer(unit, map.currentPlayer) &&
needsSupply(unit) &&
info.configuration.supplyTypes?.has(unit.info.type)
) {
vectors.push(vector);
}
}
Expand Down

0 comments on commit 8472ad4

Please sign in to comment.