Fixes dir flip (#23116)

Co-authored-by: adrermail@gmail.com <adrermail@gmail.com>
This commit is contained in:
Adrer
2023-11-02 22:45:07 -05:00
committed by GitHub
co-authored by adrermail@gmail.com <adrermail@gmail.com>
parent adbfe5e2fb
commit 951d04f930
+2 -2
View File
@@ -16,9 +16,9 @@
/// hence EAST (0010) XOR EAST|WEST (0011) --> WEST (0001)
///Flips a direction along the horizontal axis, will convert E -> W, W -> E, NE -> NW, SE -> SW, etc
#define FLIP_DIR_HORIZONTALLY(dir) (dir ^ (EAST|WEST))
#define FLIP_DIR_HORIZONTALLY(dir) ((dir & (EAST|WEST)) ? dir ^ (EAST|WEST) : dir)
///Flips a direction along the vertical axis, will convert N -> S, S -> N, NE -> SE, SW -> NW, etc
#define FLIP_DIR_VERTICALLY(dir) (dir ^ (NORTH|SOUTH))
#define FLIP_DIR_VERTICALLY(dir) ((dir & (NORTH|SOUTH)) ? dir ^ (NORTH|SOUTH) : dir)
/// for directions, each cardinal direction only has 1 TRUE bit, so `1000` or `0100` for example, so when you subtract 1
/// from a cardinal direction it results in that directions initial TRUE bit always switching to FALSE, so if you & check it