Skip to content

Commit

Permalink
Fix reverse_direction() macro (#7075)
Browse files Browse the repository at this point in the history
# About the pull request
Despite taking an argument for a direction, reverse_direction() used the
`dir` of `src` at all times. This isn't intended and has been fixed.

# Explain why it's good for the game
Bug fix. No current uses of reverse_direction() will be affected by this
change, as they all already were looking for `src.dir`[^1]

[^1]: There is one exception but it still works fine
  • Loading branch information
Zonespace27 committed Sep 4, 2024
1 parent 6dd69dc commit d053689
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions code/__HELPERS/unsorted.dm
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,8 @@
#define format_frequency(f) "[floor((f) / 10)].[(f) % 10]"

#define reverse_direction(direction) ( \
( dir & (NORTH|SOUTH) ? ~dir & (NORTH|SOUTH) : 0 ) | \
( dir & (EAST|WEST) ? ~dir & (EAST|WEST) : 0 ) \
( direction & (NORTH|SOUTH) ? ~direction & (NORTH|SOUTH) : 0 ) | \
( direction & (EAST|WEST) ? ~direction & (EAST|WEST) : 0 ) \
)

// The sane, counter-clockwise angle to turn to get from /direction/ A to /direction/ B
Expand Down

0 comments on commit d053689

Please sign in to comment.