Skip to content

Commit

Permalink
Resin doors not close on mob/living if they are merged with the weeds
Browse files Browse the repository at this point in the history
  • Loading branch information
Drulikar committed Nov 21, 2023
1 parent 56a0b3e commit fb3edaf
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions code/modules/cm_aliens/XenoStructures.dm
Original file line number Diff line number Diff line change
Expand Up @@ -422,14 +422,22 @@
if(!isSwitchingStates && state == 1)
Close()

/obj/structure/mineral_door/resin/proc/close_blocked()
for(var/turf/turf in locs)
for(var/mob/living/living_mob in turf)
var/datum/component/weed_food/weed = living_mob.GetComponent(/datum/component/weed_food)
if(!weed?.merged)
return TRUE
return FALSE

/obj/structure/mineral_door/resin/Close()
if(!state || !loc) return //already closed
//Can't close if someone is blocking it
for(var/turf/turf in locs)
if(locate(/mob/living) in turf)
spawn (close_delay)
Close()
return
if(close_blocked())
spawn(close_delay)
Close()
return

isSwitchingStates = 1
playsound(loc, "alien_resin_move", 25)
flick("[mineralType]closing",src)
Expand All @@ -440,10 +448,10 @@
update_icon()
isSwitchingStates = 0
layer = DOOR_CLOSED_LAYER
for(var/turf/turf in locs)
if(locate(/mob/living) in turf)
Open()
return

if(close_blocked())
Open()
return

/obj/structure/mineral_door/resin/Dismantle(devastated = 0)
qdel(src)
Expand Down

0 comments on commit fb3edaf

Please sign in to comment.