From 81d671b4640753eb18603efbfb731e26c3151bdc Mon Sep 17 00:00:00 2001 From: moxian Date: Sat, 30 Apr 2022 14:55:08 +0000 Subject: [PATCH] Prevent solid objects from turret deployment. (#17662) * Prevent solid objects from turret deployment. * Styling Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> * dm idioms Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> Co-authored-by: AffectedArc07 <25063394+AffectedArc07@users.noreply.github.com> --- code/game/machinery/portable_turret.dm | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm index 027259adb79..84e292f48cc 100644 --- a/code/game/machinery/portable_turret.dm +++ b/code/game/machinery/portable_turret.dm @@ -621,6 +621,14 @@ GLOBAL_LIST_EMPTY(turret_icons) return if(stat & BROKEN) return + // check if anything's preventing us from raising + var/turf/T = get_turf(src) + for(var/atom/A in T) + if(A == src) + continue + if(A.density) + return + set_raised_raising(raised, TRUE) playsound(get_turf(src), 'sound/effects/turret/open.wav', 60, 1) update_icon()