Skip to content

Commit

Permalink
Warn user during open airlock repair attempts (#22158)
Browse files Browse the repository at this point in the history
* Warn user during open airlock repair attempts

This commit adds a check for non-closed airlocks during the repair
logic, and returns the user a warning message that airlocks must be
closed for repairs to work. This avoids the animation cycle of an
interrupted repair attempt, and clarifies that repairs cannot be
attempted in this state.

Fixes #13724.

* Use density property to determine repairable state

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 authored Sep 5, 2023
1 parent 482ca46 commit 10141a7
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions code/game/machinery/doors/airlock.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1149,6 +1149,10 @@ 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)
// 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>", \
"<span class='notice'>You begin repairing the airlock...</span>", \
"<span class='italics'>You hear welding.</span>")
Expand Down

0 comments on commit 10141a7

Please sign in to comment.