Skip to content

Commit

Permalink
Use density property to determine repairable state
Browse files Browse the repository at this point in the history
After discussion with @JimKil3 using `icon_state` is problematic,
especially for sub-objects that may use alternate names for icon_state.

As airlocks aren't interactable during animation, using density here
should only attempt repairs when the door is solid.
  • Loading branch information
Stealthii committed Aug 29, 2023
1 parent 1d4a7bf commit 43eb053
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1149,7 +1149,8 @@ GLOBAL_LIST_EMPTY(airlock_emissive_underlays)
"<span class='notice'>You [welded ? "weld the airlock shut":"unweld the airlock"].</span>")
update_icon()
else if(obj_integrity < max_integrity)
if(icon_state != "closed")
// Only attempt repairs if the door is solid (albeit closed)
if(!density)
to_chat(user, "<span class='warning'>The airlock must be closed for repairs.</span>")
return
user.visible_message("<span class='notice'>[user] is welding the airlock.</span>", \
Expand Down

0 comments on commit 43eb053

Please sign in to comment.