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

View File

@@ -45,8 +45,9 @@
/obj/machinery/computer/communications/process()
if(..())
if(state != STATE_STATUSDISPLAY && state != STATE_CALLSHUTTLE && state != STATE_PURCHASE && state != STATE_VIEWMESSAGE)
updateDialog()
var/ai_autoupdate = aistate != STATE_STATUSDISPLAY && aistate != STATE_CALLSHUTTLE && aistate != STATE_PURCHASE && aistate != STATE_VIEWMESSAGE
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)
if(..())

View File

@@ -138,19 +138,22 @@
else
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.
if(obj_flags & IN_USE)
var/list/nearby = viewers(1, src)
var/is_in_use = 0
for(var/mob/M in nearby)
if ((M.client && M.machine == src))
is_in_use = 1
src.interact(M)
var/ai_in_use = AutoUpdateAI(src)
var/is_in_use = FALSE
if(update_viewers)
for(var/mob/M in viewers(1, src))
if ((M.client && M.machine == src))
is_in_use = TRUE
src.interact(M)
var/ai_in_use = FALSE
if(update_ais)
ai_in_use = AutoUpdateAI(src)
if(!ai_in_use && !is_in_use)
obj_flags &= ~IN_USE
if(update_viewers && update_ais) //State change is sure only if we check both
if(!ai_in_use && !is_in_use)
obj_flags &= ~IN_USE
/obj/attack_ghost(mob/user)