diff --git a/code/controllers/subsystems/machines.dm b/code/controllers/subsystems/machines.dm index 29d6ecce56..6f4dc53f8e 100644 --- a/code/controllers/subsystems/machines.dm +++ b/code/controllers/subsystems/machines.dm @@ -121,11 +121,10 @@ SUBSYSTEM_DEF(machines) while(current_run.len) var/obj/machinery/M = current_run[current_run.len] current_run.len-- - - if(!istype(M) || QDELETED(M) || (M.process(wait) == PROCESS_KILL)) + var/q = QDELETED(M) //CHOMPStation edit + if(!istype(M) || q || (M.process(wait) == PROCESS_KILL)) //CHOMPStation edit global.processing_machines.Remove(M) - if(!QDELETED(M)) - DISABLE_BITFIELD(M.datum_flags, DF_ISPROCESSING) + M.datum_flags &= ~DF_ISPROCESSING + q*DF_ISPROCESSING; //CHOMPStation edit if(MC_TICK_CHECK) return diff --git a/code/modules/mob/living/bot/bot.dm b/code/modules/mob/living/bot/bot.dm index 0822dca375..0256d02a69 100644 --- a/code/modules/mob/living/bot/bot.dm +++ b/code/modules/mob/living/bot/bot.dm @@ -23,6 +23,7 @@ var/list/req_one_access = list() var/atom/target = null + var/list/ignore_past = list() //CHOMPStation edit var/list/ignore_list = list() var/list/patrol_path = list() var/list/target_path = list() @@ -165,7 +166,15 @@ if(ignore_list.len) for(var/atom/A in ignore_list) if(!A || !A.loc || prob(1)) - ignore_list -= A + //CHOMPEdit Begin + if(A in ignore_past) + if(prob(10/ignore_past[A]) || !A || !A.loc) + ignore_past[A]++ + ignore_list -= A + else + ignore_past[A] = 1 + ignore_list -= A + //CHOMPEdit End handleRegular() var/panic_speed_mod = 0 @@ -243,7 +252,7 @@ if(makeStep(target_path)) frustration = 0 else if(max_frustration) - ++frustration + frustration++ //CHOMPEdit return /mob/living/bot/proc/handleFrustrated(var/targ) @@ -265,7 +274,12 @@ return 1 /mob/living/bot/proc/handlePatrol() - makeStep(patrol_path) + //CHOMPEdit Begin + if(makeStep(patrol_path)) + frustration = 0 + else if(max_frustration) + frustration++ + //CHOMPEdit End return /mob/living/bot/proc/startPatrol() @@ -309,6 +323,8 @@ ignore_list |= target resetTarget() obstacle = null + else if(target in ignore_past) //CHOMPEdit + ignore_past.Remove(target) //CHOMPEdit return /mob/living/bot/proc/makeStep(var/list/path) @@ -324,8 +340,8 @@ /mob/living/bot/proc/resetTarget() target = null target_path = list() - frustration = 0 - obstacle = null + //CHOMPEdit frustration = 0 + //CHOMPEdit obstacle = null /mob/living/bot/proc/turn_on() if(stat) diff --git a/code/modules/mob/living/bot/cleanbot.dm b/code/modules/mob/living/bot/cleanbot.dm index 6a4c45f123..4a7be72944 100644 --- a/code/modules/mob/living/bot/cleanbot.dm +++ b/code/modules/mob/living/bot/cleanbot.dm @@ -5,6 +5,7 @@ req_one_access = list(access_robotics, access_janitor) botcard_access = list(access_janitor) + max_frustration = 12 //CHOMPEdit locked = 0 // Start unlocked so roboticist can set them to patrol. wait_if_pulled = 1 min_target_dist = 0 diff --git a/code/modules/mob/living/bot/medbot.dm b/code/modules/mob/living/bot/medbot.dm index 68e803af87..25515e317d 100644 --- a/code/modules/mob/living/bot/medbot.dm +++ b/code/modules/mob/living/bot/medbot.dm @@ -14,6 +14,7 @@ icon_state = "medibot0" req_one_access = list(access_robotics, access_medical) botcard_access = list(access_medical, access_morgue, access_surgery, access_chemistry, access_virology, access_genetics) + max_frustration = 7 //CHOMPEdit var/skin = null //Set to "tox", "ointment" or "o2" for the other two firstaid kits. diff --git a/code/modules/mob/living/bot/secbot.dm b/code/modules/mob/living/bot/secbot.dm index 1fce90b611..7b99d1fa29 100644 --- a/code/modules/mob/living/bot/secbot.dm +++ b/code/modules/mob/living/bot/secbot.dm @@ -12,6 +12,7 @@ botcard_access = list(access_security, access_sec_doors, access_forensics_lockers, access_maint_tunnels) patrol_speed = 2 target_speed = 3 + max_frustration = 7 //CHOMPEdit density = 1