Bugfix: identifyCardinalDirection reported directions backwards
Which happened to cancel out that potentialCoverDirections fed in its arguments backwards
This commit is contained in:
parent
36aba598e8
commit
f3db53120c
|
@ -171,7 +171,7 @@ applyEffect (ResolveAttack attacker attack defender) board = Roll actualDiceRoll
|
||||||
attackerPosition = unitPosition board attacker
|
attackerPosition = unitPosition board attacker
|
||||||
defenderPosition = unitPosition board defender
|
defenderPosition = unitPosition board defender
|
||||||
potentialCoverDirections =
|
potentialCoverDirections =
|
||||||
usingBoardDimensions board identifyCardinalDirection <$> attackerPosition <*> defenderPosition
|
usingBoardDimensions board identifyCardinalDirection <$> defenderPosition <*> attackerPosition
|
||||||
potentialCoverLocations =
|
potentialCoverLocations =
|
||||||
fromMaybe [] $
|
fromMaybe [] $
|
||||||
(mapMaybe . offsetB board <$> defenderPosition) <*> potentialCoverDirections
|
(mapMaybe . offsetB board <$> defenderPosition) <*> potentialCoverDirections
|
||||||
|
|
|
@ -303,12 +303,12 @@ identifyCardinalDirection w _ from to = northOrSouth ++ eastOrWest
|
||||||
(fromX, fromY) = coordinates w from
|
(fromX, fromY) = coordinates w from
|
||||||
(toX, toY) = coordinates w to
|
(toX, toY) = coordinates w to
|
||||||
northOrSouth
|
northOrSouth
|
||||||
| fromY > toY = [South]
|
| fromY < toY = [South]
|
||||||
| fromY < toY = [North]
|
| fromY > toY = [North]
|
||||||
| otherwise = [ ]
|
| otherwise = [ ]
|
||||||
eastOrWest
|
eastOrWest
|
||||||
| fromX > toX = [East]
|
| fromX < toX = [East]
|
||||||
| fromX < toX = [West]
|
| fromX > toX = [West]
|
||||||
| otherwise = [ ]
|
| otherwise = [ ]
|
||||||
|
|
||||||
cardinalDirections :: [[OrthagonalDirection]]
|
cardinalDirections :: [[OrthagonalDirection]]
|
||||||
|
|
Loading…
Reference in a new issue