Improve scrubbers (#17892)

* sd

* unrelated bug i found

* fafsd
This commit is contained in:
Fluffy
2023-12-09 21:28:52 +00:00
committed by GitHub
parent 1a246e1dc8
commit bed6bc3d73
4 changed files with 70 additions and 20 deletions
+20 -2
View File
@@ -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)