From 53b8c0517e7154b18a2dd387fe7a79d649505b7e Mon Sep 17 00:00:00 2001 From: Daylight <18598676+Daylight2@users.noreply.github.com> Date: Fri, 17 May 2024 01:00:05 +0300 Subject: [PATCH] Infrared emitter lasers no longer float off into space. Fixes #25317 (#25445) * My application for headcoder * Revert "My application for headcoder" This reverts commit 63437ffcca3dfe2483114054f46322e6e1403a9d. * This is a much better idea * Whitespace * Readability cleanup * Webedit my beloved Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> Signed-off-by: Daylight <18598676+Daylight2@users.noreply.github.com> --------- Signed-off-by: Daylight <18598676+Daylight2@users.noreply.github.com> Co-authored-by: DGamerL <108773801+DGamerL@users.noreply.github.com> --- code/game/atoms_movable.dm | 33 ++++++++++++++++--------------- code/modules/assembly/infrared.dm | 3 +++ 2 files changed, 20 insertions(+), 16 deletions(-) diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index 29bc7c1900a..67973ec313b 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -199,7 +199,8 @@ Moved(old_loc, direction, TRUE) /atom/movable/Move(atom/newloc, direct = 0, movetime) - if(!loc || !newloc) return 0 + if(!loc || !newloc) + return FALSE var/atom/oldloc = loc if(loc != newloc) @@ -321,7 +322,7 @@ Moved(old_loc, NONE) - return 1 + return TRUE /atom/movable/proc/onTransitZ(old_z,new_z) for(var/item in src) // Notify contents of Z-transition. This can be overridden if we know the items contents do not care. @@ -348,36 +349,36 @@ //Called whenever an object moves and by mobs when they attempt to move themselves through space //And when an object or action applies a force on src, see newtonian_move() below -//Return 0 to have src start/keep drifting in a no-grav area and 1 to stop/not start drifting -//Mobs should return 1 if they should be able to move of their own volition, see client/Move() in mob_movement.dm +//return FALSE to have src start/keep drifting in a no-grav area and TRUE to stop/not start drifting +//Mobs should return TRUE if they should be able to move of their own volition, see client/Move() in mob_movement.dm //movement_dir == 0 when stopping or any dir when trying to move /atom/movable/proc/Process_Spacemove(movement_dir = 0) if(has_gravity(src)) - return 1 + return TRUE if(pulledby && !pulledby.pulling) - return 1 + return TRUE if(throwing) - return 1 + return TRUE if(locate(/obj/structure/lattice) in range(1, get_turf(src))) //Not realistic but makes pushing things in space easier - return 1 + return TRUE - return 0 + return FALSE /atom/movable/proc/newtonian_move(direction) //Only moves the object if it's under no gravity if(!loc || Process_Spacemove(0)) inertia_dir = 0 - return 0 + return FALSE inertia_dir = direction if(!direction) - return 1 + return TRUE inertia_last_loc = loc SSspacedrift.processing[src] = src - return 1 + return TRUE //called when src is thrown into hit_atom /atom/movable/proc/throw_impact(atom/hit_atom, throwingdatum) @@ -397,7 +398,7 @@ /atom/movable/proc/throw_at(atom/target, range, speed, mob/thrower, spin = TRUE, diagonals_first = FALSE, datum/callback/callback, force = INFINITY, dodgeable = TRUE, block_movement = TRUE) if(!target || (flags & NODROP) || speed <= 0) - return 0 + return FALSE if(pulledby) pulledby.stop_pulling() @@ -500,8 +501,8 @@ last_move = buckled_mob.last_move inertia_dir = last_move buckled_mob.inertia_dir = last_move - return 0 - return 1 + return FALSE + return TRUE /atom/movable/proc/force_pushed(atom/movable/pusher, force = MOVE_FORCE_DEFAULT, direction) return FALSE @@ -521,7 +522,7 @@ /atom/movable/CanPass(atom/movable/mover, turf/target, height=1.5) if(mover in buckled_mobs) - return 1 + return TRUE return ..() /atom/movable/proc/get_spacemove_backup() diff --git a/code/modules/assembly/infrared.dm b/code/modules/assembly/infrared.dm index f3315c480e4..2a293d76324 100644 --- a/code/modules/assembly/infrared.dm +++ b/code/modules/assembly/infrared.dm @@ -227,6 +227,9 @@ /obj/effect/beam/i_beam/update_icon_state() transform = turn(matrix(), dir2angle(dir)) +/obj/effect/beam/i_beam/Process_Spacemove(movement_dir) + return TRUE + /obj/effect/beam/i_beam/process() life_cycles++ if(loc.density || !master || life_cycles >= life_cap)