diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm index 445ed389b7..d1e3de1248 100755 --- a/code/game/machinery/computer/communications.dm +++ b/code/game/machinery/computer/communications.dm @@ -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(..()) diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm index 02e1cc9bd0..664cdbf383 100644 --- a/code/game/objects/objs.dm +++ b/code/game/objects/objs.dm @@ -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)