Gives better feedback to the AI when opening doors from chat. Fix runtime

This commit is contained in:
joep van der velden
2020-09-21 16:36:54 +02:00
parent 53d8819639
commit d7030d9d82
2 changed files with 8 additions and 4 deletions
+4 -2
View File
@@ -846,12 +846,14 @@ About the new airlock wires panel:
/obj/machinery/door/airlock/proc/open_close(mob/user)
if(welded)
to_chat(user, "<span class='warning'>The airlock has been welded shut!</span>")
return FALSE
else if(locked)
to_chat(user, "<span class='warning'>The door bolts are down!</span>")
return FALSE
else if(density)
open()
return open()
else
close()
return close()
/obj/machinery/door/airlock/proc/toggle_light(mob/user)
if(wires.is_cut(WIRE_BOLT_LIGHT))
+4 -2
View File
@@ -1332,8 +1332,10 @@ GLOBAL_LIST_INIT(ai_verbs_default, list(
if(istype(A))
switch(alert(src, "Do you want to open \the [A] for [target]?", "Doorknob_v2a.exe", "Yes", "No"))
if("Yes")
A.AIShiftClick()
to_chat(src, "<span class='notice'>You open \the [A] for [target].</span>")
if(!A.density)
to_chat(src, "<span class='notice'>[A] was already opened.</span>")
else if(A.open_close(src))
to_chat(src, "<span class='notice'>You open \the [A] for [target].</span>")
else
to_chat(src, "<span class='warning'>You deny the request.</span>")
else