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
|
||||
defenderPosition = unitPosition board defender
|
||||
potentialCoverDirections =
|
||||
usingBoardDimensions board identifyCardinalDirection <$> attackerPosition <*> defenderPosition
|
||||
usingBoardDimensions board identifyCardinalDirection <$> defenderPosition <*> attackerPosition
|
||||
potentialCoverLocations =
|
||||
fromMaybe [] $
|
||||
(mapMaybe . offsetB board <$> defenderPosition) <*> potentialCoverDirections
|
||||
|
|
|
@ -303,12 +303,12 @@ identifyCardinalDirection w _ from to = northOrSouth ++ eastOrWest
|
|||
(fromX, fromY) = coordinates w from
|
||||
(toX, toY) = coordinates w to
|
||||
northOrSouth
|
||||
| fromY > toY = [South]
|
||||
| fromY < toY = [North]
|
||||
| fromY < toY = [South]
|
||||
| fromY > toY = [North]
|
||||
| otherwise = [ ]
|
||||
eastOrWest
|
||||
| fromX > toX = [East]
|
||||
| fromX < toX = [West]
|
||||
| fromX < toX = [East]
|
||||
| fromX > toX = [West]
|
||||
| otherwise = [ ]
|
||||
|
||||
cardinalDirections :: [[OrthagonalDirection]]
|
||||
|
|
Loading…
Reference in a new issue