mirror of
https://github.com/Aurorastation/Aurora.3.git
synced 2026-08-21 03:51:49 +01:00
@@ -172,15 +172,33 @@ default behaviour is:
|
||||
|
||||
now_pushing = FALSE
|
||||
|
||||
/**
|
||||
* Checks if two mobs can swap with each other based on the density
|
||||
*
|
||||
* Returns `TRUE` if the density allows them to swap, `FALSE` otherwise
|
||||
*
|
||||
* swapper - A `/mob`, the one trying to perform the swap
|
||||
* swapee - A `/mob`, the one the `swapper` is trying to swap with
|
||||
*/
|
||||
/proc/swap_density_check(var/mob/swapper, var/mob/swapee)
|
||||
SHOULD_NOT_SLEEP(TRUE)
|
||||
SHOULD_BE_PURE(TRUE)
|
||||
|
||||
var/turf/T = get_turf(swapper)
|
||||
|
||||
if(!T)
|
||||
return FALSE
|
||||
|
||||
if(T.density)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
for(var/atom/movable/A in T)
|
||||
|
||||
if(A == swapper)
|
||||
continue
|
||||
|
||||
if(!A.CanPass(swapee, T, 1))
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/mob/living/proc/can_swap_with(var/mob/living/tmob)
|
||||
if(tmob.buckled_to || buckled_to)
|
||||
|
||||
Reference in New Issue
Block a user