mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 04:26:03 +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:
@@ -142,7 +142,7 @@
|
||||
for (var/S in SSshuttle.stationary_docking_ports)
|
||||
var/obj/docking_port/stationary/SM = S
|
||||
if (SM.shuttle_id == "emergency_home")
|
||||
var/new_dir = turn(SM.dir, 180)
|
||||
var/new_dir = REVERSE_DIR(SM.dir)
|
||||
SM.forceMove(get_ranged_target_turf(SM, new_dir, crash_strength))
|
||||
break
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ GLOBAL_LIST_EMPTY(dirty_vars)
|
||||
if(!(locate(/obj/structure/grille) in T))
|
||||
var/window_check = 0
|
||||
for(var/obj/structure/window/W in T)
|
||||
if (W.dir == turn(C1.dir,180) || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST)) )
|
||||
if (W.dir == REVERSE_DIR(C1.dir) || (W.dir in list(NORTHEAST,SOUTHEAST,NORTHWEST,SOUTHWEST)) )
|
||||
window_check = 1
|
||||
break
|
||||
if(!window_check)
|
||||
|
||||
Reference in New Issue
Block a user