mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-27 23:27:34 +01:00
[MIRROR] Implements usage of the REVERSE_DIR macro throughout the code. [MDB IGNORE] (#22743)
* Implements usage of the REVERSE_DIR macro throughout the code. (#77122) ## About The Pull Request Replaces a ton of `turn(dir, 180)` calls with the aforementioned macro. ## Why It's Good For The Game Afaik, `REVERSE_DIR` was coded to be faster than the classic `turn(dir, 180)` call, being a simple set of binary operations. To sum it up, micro optimization. ## Changelog N/A * Implements usage of the REVERSE_DIR macro throughout the code. --------- Co-authored-by: Ghom <42542238+Ghommie@users.noreply.github.com>
This commit is contained in:
@@ -34,7 +34,7 @@
|
||||
/// We're offset back into the wall, account for that
|
||||
/obj/structure/fireplace/get_light_offset()
|
||||
var/list/hand_back = ..()
|
||||
var/list/dir_offset = dir2offset(turn(dir, 180))
|
||||
var/list/dir_offset = dir2offset(REVERSE_DIR(dir))
|
||||
hand_back[1] += dir_offset[1] * 0.5
|
||||
hand_back[2] += dir_offset[2] * 0.5
|
||||
return hand_back
|
||||
|
||||
Reference in New Issue
Block a user