mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-20 20:45:28 +01:00
[MIRROR] Removes SQRT_2 and its usages [MDB IGNORE] (#18940)
* Removes SQRT_2 and its usages (#72913) Signed-off-by: GitHub <noreply@github.com> ## About The Pull Request ## Why It's Good For The Game Resolves #72534 ## Changelog Signed-off-by: GitHub <noreply@github.com> * Update mod_pai.dm Signed-off-by: GitHub <noreply@github.com> Co-authored-by: Zephyr <12817816+ZephyrTFA@users.noreply.github.com> Co-authored-by: Zonespace <41448081+Zonespace27@users.noreply.github.com>
This commit is contained in:
@@ -16,7 +16,6 @@
|
||||
|
||||
#define NUM_E 2.71828183
|
||||
|
||||
#define SQRT_2 1.414214 //CLOSE ENOUGH!
|
||||
|
||||
#define PI 3.1416
|
||||
#define INFINITY 1e31 //closer then enough
|
||||
|
||||
@@ -125,7 +125,7 @@
|
||||
|
||||
//We are now going to move
|
||||
var/add_delay = mob.cached_multiplicative_slowdown
|
||||
var/new_glide_size = DELAY_TO_GLIDE_SIZE(add_delay * ( (NSCOMPONENT(direct) && EWCOMPONENT(direct)) ? SQRT_2 : 1 ) )
|
||||
var/new_glide_size = DELAY_TO_GLIDE_SIZE(add_delay * ( (NSCOMPONENT(direct) && EWCOMPONENT(direct)) ? sqrt(2) : 1 ) )
|
||||
mob.set_glide_size(new_glide_size) // set it now in case of pulled objects
|
||||
//If the move was recent, count using old_move_delay
|
||||
//We want fractional behavior and all
|
||||
@@ -143,7 +143,7 @@
|
||||
. = ..()
|
||||
|
||||
if((direct & (direct - 1)) && mob.loc == new_loc) //moved diagonally successfully
|
||||
add_delay *= SQRT_2
|
||||
add_delay *= sqrt(2)
|
||||
|
||||
var/after_glide = 0
|
||||
if(visual_delay)
|
||||
|
||||
@@ -77,7 +77,7 @@
|
||||
/obj/item/mod/control/relaymove(mob/user, direction)
|
||||
if((!active && wearer) || get_charge() < CHARGE_PER_STEP || user != ai || !COOLDOWN_FINISHED(src, cooldown_mod_move) || (wearer?.pulledby?.grab_state > GRAB_PASSIVE))
|
||||
return FALSE
|
||||
var/timemodifier = MOVE_DELAY * (ISDIAGONALDIR(direction) ? SQRT_2 : 1) * (wearer ? WEARER_DELAY : LONE_DELAY)
|
||||
var/timemodifier = MOVE_DELAY * (ISDIAGONALDIR(direction) ? sqrt(2) : 1) * (wearer ? WEARER_DELAY : LONE_DELAY)
|
||||
if(wearer && !wearer.Process_Spacemove(direction))
|
||||
return FALSE
|
||||
else if(!wearer && (!has_gravity() || !isturf(loc)))
|
||||
|
||||
@@ -91,7 +91,7 @@
|
||||
return FALSE
|
||||
if(wearer && (wearer.pulledby?.grab_state || wearer.incapacitated() || wearer.stat))
|
||||
return FALSE
|
||||
var/timemodifier = MOVE_DELAY * (ISDIAGONALDIR(direction) ? SQRT_2 : 1) * (wearer ? WEARER_DELAY : LONE_DELAY)
|
||||
var/timemodifier = MOVE_DELAY * (ISDIAGONALDIR(direction) ? sqrt(2) : 1) * (wearer ? WEARER_DELAY : LONE_DELAY)
|
||||
COOLDOWN_START(src, cooldown_mod_move, movedelay * timemodifier + slowdown)
|
||||
playsound(src, 'sound/mecha/mechmove01.ogg', 25, TRUE)
|
||||
core.subtract_charge(CELL_PER_STEP)
|
||||
|
||||
Reference in New Issue
Block a user