Skip to content

Infrared emitter lasers no longer float off into space. Fixes #25317 #25445

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
May 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 17 additions & 16 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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.
Expand All @@ -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)
Expand All @@ -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()
Expand Down Expand Up @@ -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
Expand All @@ -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()
Expand Down
3 changes: 3 additions & 0 deletions code/modules/assembly/infrared.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down