Merge pull request #7211 from Citadel-Station-13/upstream-merge-38534

[MIRROR] Fixes AI's being unable to call shuttle using comm console.
This commit is contained in:
LetterJay
2018-06-24 15:16:09 -05:00
committed by GitHub
2 changed files with 16 additions and 12 deletions
@@ -45,8 +45,9 @@
/obj/machinery/computer/communications/process() /obj/machinery/computer/communications/process()
if(..()) if(..())
if(state != STATE_STATUSDISPLAY && state != STATE_CALLSHUTTLE && state != STATE_PURCHASE && state != STATE_VIEWMESSAGE) var/ai_autoupdate = aistate != STATE_STATUSDISPLAY && aistate != STATE_CALLSHUTTLE && aistate != STATE_PURCHASE && aistate != STATE_VIEWMESSAGE
updateDialog() var/machine_user_autoupdate = state != STATE_STATUSDISPLAY && state != STATE_CALLSHUTTLE && state != STATE_PURCHASE && state != STATE_VIEWMESSAGE
updateDialog(machine_user_autoupdate,ai_autoupdate)
/obj/machinery/computer/communications/Topic(href, href_list) /obj/machinery/computer/communications/Topic(href, href_list)
if(..()) if(..())
+13 -10
View File
@@ -138,19 +138,22 @@
else else
obj_flags &= ~IN_USE obj_flags &= ~IN_USE
/obj/proc/updateDialog() /obj/proc/updateDialog(update_viewers = TRUE,update_ais = TRUE)
// Check that people are actually using the machine. If not, don't update anymore. // Check that people are actually using the machine. If not, don't update anymore.
if(obj_flags & IN_USE) if(obj_flags & IN_USE)
var/list/nearby = viewers(1, src) var/is_in_use = FALSE
var/is_in_use = 0 if(update_viewers)
for(var/mob/M in nearby) for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src)) if ((M.client && M.machine == src))
is_in_use = 1 is_in_use = TRUE
src.interact(M) src.interact(M)
var/ai_in_use = AutoUpdateAI(src) var/ai_in_use = FALSE
if(update_ais)
ai_in_use = AutoUpdateAI(src)
if(!ai_in_use && !is_in_use) if(update_viewers && update_ais) //State change is sure only if we check both
obj_flags &= ~IN_USE if(!ai_in_use && !is_in_use)
obj_flags &= ~IN_USE
/obj/attack_ghost(mob/user) /obj/attack_ghost(mob/user)