From efbea12d995072c9b57cd5e8d5c8c5f24e1f3127 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Sun, 2 Jun 2013 17:10:47 +0400 Subject: [PATCH 1/2] Stops air alarm masters from polling each alarm every tick. Now polling occurs only when alarm danger level changes. --- code/game/machinery/alarm.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm index 4d7a32b04f3..d52f18fdd70 100644 --- a/code/game/machinery/alarm.dm +++ b/code/game/machinery/alarm.dm @@ -170,10 +170,10 @@ visible_message("\The [src] clicks quietly as it stops [environment.temperature > target_temperature ? "cooling" : "heating"] the room.",\ "You hear a click as a faint electronic humming stops.") - + var/old_level = danger_level danger_level = overall_danger_level() - if (alarm_area.master_air_alarm == src) + if (old_level != danger_level) refresh_danger_level() update_icon() From 56dcb8b7f0eb2a60f7d761e27d2b5a38d0ed6271 Mon Sep 17 00:00:00 2001 From: Chinsky Date: Sun, 2 Jun 2013 17:14:13 +0400 Subject: [PATCH 2/2] Fixes #2915 --- code/game/machinery/bots/medbot.dm | 1 + code/game/machinery/bots/secbot.dm | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/code/game/machinery/bots/medbot.dm b/code/game/machinery/bots/medbot.dm index 71cccfdc3ee..31fbb8c4679 100644 --- a/code/game/machinery/bots/medbot.dm +++ b/code/game/machinery/bots/medbot.dm @@ -299,6 +299,7 @@ if(src.patient && src.path.len == 0 && (get_dist(src,src.patient) > 1)) spawn(0) src.path = AStar(src.loc, get_turf(src.patient), /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 30,id=botcard) + if (!path) path = list() if(src.path.len == 0) src.oldpatient = src.patient src.patient = null diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm index 19a43f41cc7..fb3646653c1 100644 --- a/code/game/machinery/bots/secbot.dm +++ b/code/game/machinery/bots/secbot.dm @@ -583,7 +583,7 @@ Auto Patrol: []"}, // given an optional turf to avoid /obj/machinery/bot/secbot/proc/calc_path(var/turf/avoid = null) src.path = AStar(src.loc, patrol_target, /turf/proc/CardinalTurfsWithAccess, /turf/proc/Distance, 0, 120, id=botcard, exclude=avoid) - + if (!path) path = list() // look for a criminal in view of the bot