Fixes AI's being unable to call shuttle using comm console. (#38534)

* Fixes AI's being unable to call shuttle using comm console.

* Lets get rid of double negatives

* viewvers for
This commit is contained in:
AnturK
2018-06-21 02:38:51 +02:00
committed by letterjay
parent 7cb838b4cf
commit 5e156e7a07
2 changed files with 16 additions and 12 deletions
+13 -10
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)