Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix resin doors not closing on mob/living if they are merged with weeds #4990

Merged
merged 3 commits into from
Nov 22, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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)
fira marked this conversation as resolved.
Show resolved Hide resolved
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()
fira marked this conversation as resolved.
Show resolved Hide resolved
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
Loading