diff --git a/code/game/atoms_movable.dm b/code/game/atoms_movable.dm index b511c9befd2..fe9f99b0328 100644 --- a/code/game/atoms_movable.dm +++ b/code/game/atoms_movable.dm @@ -115,12 +115,7 @@ else if(isturf(hit_atom)) src.throwing = 0 var/turf/T = hit_atom - if(T.density) - spawn(2) - step(src, turn(src.last_move, 180)) - if(istype(src,/mob/living)) - var/mob/living/M = src - M.turf_collision(T, speed) + T.hitby(src,speed) //decided whether a movable atom being thrown can pass through the turf it is in. /atom/movable/proc/hit_check(var/speed) diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm index c13b4606d36..028223ef26f 100644 --- a/code/game/turfs/turf.dm +++ b/code/game/turfs/turf.dm @@ -243,3 +243,11 @@ var/const/enterloopsanity = 100 /turf/proc/update_blood_overlays() return +// Called when turf is hit by a thrown object +/turf/hitby(atom/movable/AM as mob|obj, var/speed) + if(src.density) + spawn(2) + step(AM, turn(AM.last_move, 180)) + if(isliving(AM)) + var/mob/living/M = AM + M.turf_collision(src, speed) diff --git a/code/modules/multiz/turf.dm b/code/modules/multiz/turf.dm index caa859f3695..b6845d076f1 100644 --- a/code/modules/multiz/turf.dm +++ b/code/modules/multiz/turf.dm @@ -36,6 +36,11 @@ ..() mover.fall() +// Called when thrown object lands on this turf. +/turf/simulated/open/hitby(var/atom/movable/AM, var/speed) + . = ..() + AM.fall() + /turf/simulated/open/proc/update() below = GetBelow(src) turf_changed_event.register(below, src, /turf/simulated/open/update_icon)