Files
Bubberstation/code/modules/shuttle/on_move.dm
Cyberboss f7c9749ca0 Fixes some bad addtimer calls. Adds INVOKE_ASYNC. Replaces addtimer(..., 0) (#23424)
* Fixes some bad addtimers

* Adds INVOKE

* Warning for addtimer

* Working syntax

* Another bad call

* Fixes the addtimer warning

* Add suppress_zero_warning to addtimer

Useful for addtimer that uses vars

* Add INVOKE_AGAIN for when the var is already defined

* Replace addtimer(...,0) with INVOKE((...))

* Much more sensible syntax

* Less overhead, less copypaste

* Rename INVOKE_ASYNC

* Use a macro

* Allman style

* Wait, why make it a datum in the first place?

* Revert the rename

* Rename again, keep line endings

* typo

* More typos

* Untouches Addtimer

* Update callbacks.dm

* Update timer.dm

* Revert allman style

* Revert "Revert allman style"

This reverts commit 47361da15bd04eca138be5f13acdc9dd5ba89331.

* Trying to match that whitespace diff

* Why is this missing?

* I'm not fucking dealing with this!
2017-01-31 09:20:54 +13:00

72 lines
1.5 KiB
Plaintext

/atom/movable/proc/onShuttleMove(turf/T1, rotation)
if(rotation)
shuttleRotate(rotation)
loc = T1
if (length(client_mobs_in_contents))
update_parallax_contents()
return 1
/obj/onShuttleMove()
if(invisibility >= INVISIBILITY_ABSTRACT)
return 0
. = ..()
/atom/movable/light/onShuttleMove()
return 0
/obj/machinery/door/onShuttleMove()
. = ..()
if(!.)
return
INVOKE_ASYNC(src, .proc/close)
// Close any attached airlocks as well
for(var/obj/machinery/door/D in orange(1, src))
INVOKE_ASYNC(src, .proc/close)
/obj/machinery/door/airlock/onShuttleMove()
shuttledocked = 0
for(var/obj/machinery/door/airlock/A in orange(1, src))
A.shuttledocked = 0
. = ..()
shuttledocked = 1
for(var/obj/machinery/door/airlock/A in orange(1, src))
A.shuttledocked = 1
/mob/onShuttleMove()
if(!move_on_shuttle)
return 0
. = ..()
if(!.)
return
if(client)
if(buckled)
shake_camera(src, 2, 1) // turn it down a bit come on
else
shake_camera(src, 7, 1)
/mob/living/carbon/onShuttleMove()
. = ..()
if(!.)
return
if(!buckled)
Weaken(3)
// Shuttle Rotation //
/atom/proc/shuttleRotate(rotation)
//rotate our direction
setDir(angle2dir(rotation+dir2angle(dir)))
//resmooth if need be.
if(smooth)
queue_smooth(src)
//rotate the pixel offsets too.
if (pixel_x || pixel_y)
if (rotation < 0)
rotation += 360
for (var/turntimes=rotation/90;turntimes>0;turntimes--)
var/oldPX = pixel_x
var/oldPY = pixel_y
pixel_x = oldPY
pixel_y = (oldPX*(-1))