mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-23 03:57:13 +01:00
Fixes dir flip (#23116)
Co-authored-by: adrermail@gmail.com <adrermail@gmail.com>
This commit is contained in:
co-authored by
adrermail@gmail.com <adrermail@gmail.com>
parent
adbfe5e2fb
commit
951d04f930
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user