diff --git a/code/game/dna/dna_modifier.dm b/code/game/dna/dna_modifier.dm
index 5360f08814e..2aacd6e3dd9 100644
--- a/code/game/dna/dna_modifier.dm
+++ b/code/game/dna/dna_modifier.dm
@@ -45,6 +45,7 @@
use_power = 1
idle_power_usage = 50
active_power_usage = 300
+ interact_offline = 1
var/locked = 0
var/mob/living/carbon/occupant = null
var/obj/item/weapon/reagent_containers/glass/beaker = null
diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm
index a1fb735efd3..8643ea0e8b5 100644
--- a/code/game/machinery/Freezer.dm
+++ b/code/game/machinery/Freezer.dm
@@ -110,6 +110,8 @@
ui.set_auto_update(1)
/obj/machinery/atmospherics/unary/cold_sink/freezer/Topic(href, href_list)
+ if(..())
+ return 1
if (href_list["toggleStatus"])
src.on = !src.on
update_icon()
diff --git a/code/game/machinery/Sleeper.dm b/code/game/machinery/Sleeper.dm
index e4db4989b0f..52476c7ce02 100644
--- a/code/game/machinery/Sleeper.dm
+++ b/code/game/machinery/Sleeper.dm
@@ -13,6 +13,7 @@
dir = 8
idle_power_usage = 250
active_power_usage = 500
+ interact_offline = 1
/obj/machinery/sleep_console/power_change()
if(stat & BROKEN)
diff --git a/code/game/machinery/adv_med.dm b/code/game/machinery/adv_med.dm
index 98747fbb3a6..a173afb2a4e 100644
--- a/code/game/machinery/adv_med.dm
+++ b/code/game/machinery/adv_med.dm
@@ -519,8 +519,8 @@
return
/obj/machinery/body_scanconsole/Topic(href, href_list)
- if(stat & (BROKEN|NOPOWER)) return
- if(usr.stat || usr.restrained()) return
+ if(..())
+ return 1
if (href_list["print_p"])
if (!(src.printing) && src.printing_text)
diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm
index 4df9f2a5a88..1bcb2eec634 100644
--- a/code/game/machinery/ai_slipper.dm
+++ b/code/game/machinery/ai_slipper.dm
@@ -83,7 +83,8 @@
return
/obj/machinery/ai_slipper/Topic(href, href_list)
- ..()
+ if(..())
+ return 1
if (src.locked)
if (!istype(usr, /mob/living/silicon))
usr << "Control panel is locked!"
diff --git a/code/game/machinery/alarm.dm b/code/game/machinery/alarm.dm
index 986fce47705..1424886eae7 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -755,8 +755,11 @@
return !locked
/obj/machinery/alarm/Topic(href, href_list)
+ if(..())
+ return 1
+
if(!can_use(usr))
- return 0
+ return 1
var/changed=0
@@ -1015,7 +1018,7 @@
playsound(get_turf(src), 'sound/items/Ratchet.ogg', 50, 1)
del(src)
- return ..()
+ return 0
/obj/machinery/alarm/power_change()
if(powered(power_channel))
diff --git a/code/game/machinery/autolathe.dm b/code/game/machinery/autolathe.dm
index a6154a21379..143853269dc 100644
--- a/code/game/machinery/autolathe.dm
+++ b/code/game/machinery/autolathe.dm
@@ -175,7 +175,7 @@
/obj/machinery/autolathe/Topic(href, href_list)
if(..())
- return
+ return 1
if (!busy)
if(href_list["menu"])
screen = text2num(href_list["menu"])
diff --git a/code/game/machinery/biogenerator.dm b/code/game/machinery/biogenerator.dm
index f834719c9e0..0a9eca25078 100644
--- a/code/game/machinery/biogenerator.dm
+++ b/code/game/machinery/biogenerator.dm
@@ -298,7 +298,7 @@
/obj/machinery/biogenerator/Topic(href, href_list)
if(..() || panel_open)
- return
+ return 1
usr.set_machine(src)
diff --git a/code/game/machinery/computer/Operating.dm b/code/game/machinery/computer/Operating.dm
index bfd979025be..9f73b206443 100644
--- a/code/game/machinery/computer/Operating.dm
+++ b/code/game/machinery/computer/Operating.dm
@@ -73,7 +73,7 @@
/obj/machinery/computer/operating/Topic(href, href_list)
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
return
diff --git a/code/game/machinery/computer/aifixer.dm b/code/game/machinery/computer/aifixer.dm
index 7a45f1a8114..febf071bfb5 100644
--- a/code/game/machinery/computer/aifixer.dm
+++ b/code/game/machinery/computer/aifixer.dm
@@ -79,7 +79,7 @@
/obj/machinery/computer/aifixer/Topic(href, href_list)
if(..())
- return
+ return 1
if (href_list["fix"])
src.active = 1
src.overlays += image('icons/obj/computer.dmi', "ai-fixer-on")
diff --git a/code/game/machinery/computer/arcade.dm b/code/game/machinery/computer/arcade.dm
index a3402129d88..972d3e6a2ca 100644
--- a/code/game/machinery/computer/arcade.dm
+++ b/code/game/machinery/computer/arcade.dm
@@ -144,7 +144,7 @@
/obj/machinery/computer/arcade/battle/Topic(href, href_list)
if(..())
- return
+ return 1
if (!src.blocked && !src.gameover)
if (href_list["attack"])
@@ -405,7 +405,7 @@
/obj/machinery/computer/arcade/orion_trail/Topic(href, href_list)
if(..())
- return
+ return 1
if(href_list["close"])
usr.unset_machine()
usr << browse(null, "window=arcade")
diff --git a/code/game/machinery/computer/atmos_alert.dm b/code/game/machinery/computer/atmos_alert.dm
index 9a0ff286700..a24ca549dce 100644
--- a/code/game/machinery/computer/atmos_alert.dm
+++ b/code/game/machinery/computer/atmos_alert.dm
@@ -98,7 +98,7 @@
/obj/machinery/computer/atmos_alert/Topic(href, href_list)
if(..())
- return
+ return 1
if(href_list["priority_clear"])
var/removing_zone = href_list["priority_clear"]
diff --git a/code/game/machinery/computer/atmos_control.dm b/code/game/machinery/computer/atmos_control.dm
index df9a3cbef9e..fb3c74e292d 100644
--- a/code/game/machinery/computer/atmos_control.dm
+++ b/code/game/machinery/computer/atmos_control.dm
@@ -115,7 +115,7 @@
//a bunch of this is copied from atmos alarms
/obj/machinery/computer/atmoscontrol/Topic(href, href_list)
if(..())
- return
+ return 1
if(href_list["reset"])
current = null
diff --git a/code/game/machinery/computer/cloning.dm b/code/game/machinery/computer/cloning.dm
index c8ae03e2c26..e197042437f 100644
--- a/code/game/machinery/computer/cloning.dm
+++ b/code/game/machinery/computer/cloning.dm
@@ -155,7 +155,7 @@
/obj/machinery/computer/cloning/Topic(href, href_list)
if(..())
- return
+ return 1
if(loading)
return
diff --git a/code/game/machinery/computer/communications.dm b/code/game/machinery/computer/communications.dm
index e4ecdb12efa..3ac81dfa985 100644
--- a/code/game/machinery/computer/communications.dm
+++ b/code/game/machinery/computer/communications.dm
@@ -60,7 +60,7 @@ var/shuttle_call/shuttle_calls[0]
/obj/machinery/computer/communications/Topic(href, href_list)
if(..(href, href_list))
- return
+ return 1
if (!(src.z in list(STATION_Z,CENTCOMM_Z)))
usr << "\red Unable to establish a connection: \black You're too far away from the station!"
diff --git a/code/game/machinery/computer/crew.dm b/code/game/machinery/computer/crew.dm
index a007c324ac4..c459b3d1e1a 100644
--- a/code/game/machinery/computer/crew.dm
+++ b/code/game/machinery/computer/crew.dm
@@ -42,7 +42,8 @@
/obj/machinery/computer/crew/Topic(href, href_list)
- if(..()) return
+ if(..())
+ return 1
if (src.z > 6)
usr << "\red Unable to establish a connection: \black You're too far away from the station!"
return 0
diff --git a/code/game/machinery/computer/hologram.dm b/code/game/machinery/computer/hologram.dm
index e57aa56fe78..ecb3ba58b3d 100644
--- a/code/game/machinery/computer/hologram.dm
+++ b/code/game/machinery/computer/hologram.dm
@@ -57,7 +57,7 @@
/obj/machinery/computer/hologram_comp/Topic(href, href_list)
if(..())
- return
+ return 1
if (in_range(src, usr))
flick("holo_console1", src)
if (href_list["power"])
diff --git a/code/game/machinery/computer/honkputer.dm b/code/game/machinery/computer/honkputer.dm
index a5efb1dd2a9..9efed74b7c9 100644
--- a/code/game/machinery/computer/honkputer.dm
+++ b/code/game/machinery/computer/honkputer.dm
@@ -16,7 +16,7 @@
/obj/machinery/computer/HONKputer/Topic(href, href_list)
if(..())
- return
+ return 1
if (src.z > 1)
usr << "\red Unable to establish a connection: \black You're too far away from the station!"
return
diff --git a/code/game/machinery/computer/medical.dm b/code/game/machinery/computer/medical.dm
index 1d9cee6a55b..23a8c3ed16f 100644
--- a/code/game/machinery/computer/medical.dm
+++ b/code/game/machinery/computer/medical.dm
@@ -128,7 +128,7 @@
/obj/machinery/computer/med_data/Topic(href, href_list)
if(..())
- return
+ return 1
if (!( data_core.general.Find(src.active1) ))
src.active1 = null
diff --git a/code/game/machinery/computer/message.dm b/code/game/machinery/computer/message.dm
index 73c469d6db4..37ab61fc857 100644
--- a/code/game/machinery/computer/message.dm
+++ b/code/game/machinery/computer/message.dm
@@ -274,7 +274,7 @@
/obj/machinery/computer/message_monitor/Topic(href, href_list)
if(..())
- return
+ return 1
if(stat & (NOPOWER|BROKEN))
return
if(!istype(usr, /mob/living))
diff --git a/code/game/machinery/computer/pod.dm b/code/game/machinery/computer/pod.dm
index 2f408817802..94636091dde 100644
--- a/code/game/machinery/computer/pod.dm
+++ b/code/game/machinery/computer/pod.dm
@@ -163,7 +163,7 @@
/obj/machinery/computer/pod/Topic(href, href_list)
if(..())
- return
+ return 1
if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["power"])
diff --git a/code/game/machinery/computer/power.dm b/code/game/machinery/computer/power.dm
index 65eb7ce4bc3..e4c51cc8dab 100644
--- a/code/game/machinery/computer/power.dm
+++ b/code/game/machinery/computer/power.dm
@@ -133,7 +133,8 @@
/obj/machinery/power/monitor/Topic(href, href_list)
- ..()
+ if(..())
+ return 1
if( href_list["close"] )
usr << browse(null, "window=powcomp")
usr.unset_machine()
diff --git a/code/game/machinery/computer/robot.dm b/code/game/machinery/computer/robot.dm
index 35552231640..632fe6aae60 100644
--- a/code/game/machinery/computer/robot.dm
+++ b/code/game/machinery/computer/robot.dm
@@ -106,7 +106,7 @@
/obj/machinery/computer/robotics/Topic(href, href_list)
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
diff --git a/code/game/machinery/computer/salvage_ship.dm b/code/game/machinery/computer/salvage_ship.dm
index a54340da4de..a67868fe3de 100644
--- a/code/game/machinery/computer/salvage_ship.dm
+++ b/code/game/machinery/computer/salvage_ship.dm
@@ -75,6 +75,8 @@
/obj/machinery/computer/salvage_ship/Topic(href, href_list)
+ if(..())
+ return 1
if(!isliving(usr)) return
var/mob/living/user = usr
diff --git a/code/game/machinery/computer/security.dm b/code/game/machinery/computer/security.dm
index ce9b239da49..de83237918c 100644
--- a/code/game/machinery/computer/security.dm
+++ b/code/game/machinery/computer/security.dm
@@ -208,7 +208,7 @@ I can't be bothered to look more of the actual code outside of switch but that p
What a mess.*/
/obj/machinery/computer/secure_data/Topic(href, href_list)
if(..())
- return
+ return 1
if (!( data_core.general.Find(active1) ))
active1 = null
if (!( data_core.security.Find(active2) ))
diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm
index 3b6a530f490..9a2372edd9a 100644
--- a/code/game/machinery/computer/skills.dm
+++ b/code/game/machinery/computer/skills.dm
@@ -151,7 +151,7 @@ I can't be bothered to look more of the actual code outside of switch but that p
What a mess.*/
/obj/machinery/computer/skills/Topic(href, href_list)
if(..())
- return
+ return 1
if (!( data_core.general.Find(active1) ))
active1 = null
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
diff --git a/code/game/machinery/computer/specops_shuttle.dm b/code/game/machinery/computer/specops_shuttle.dm
index bdfa06eeba4..7a90e1de8b1 100644
--- a/code/game/machinery/computer/specops_shuttle.dm
+++ b/code/game/machinery/computer/specops_shuttle.dm
@@ -287,7 +287,7 @@ var/specops_shuttle_timeleft = 0
/obj/machinery/computer/specops_shuttle/Topic(href, href_list)
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.machine = src
diff --git a/code/game/machinery/computer/store.dm b/code/game/machinery/computer/store.dm
index 31981544e62..9ab45f15d94 100644
--- a/code/game/machinery/computer/store.dm
+++ b/code/game/machinery/computer/store.dm
@@ -128,7 +128,7 @@ td.cost.toomuch {
/obj/machinery/computer/merch/Topic(href, href_list)
if(..())
- return
+ return 1
//testing(href)
diff --git a/code/game/machinery/computer/syndicate_specops_shuttle.dm b/code/game/machinery/computer/syndicate_specops_shuttle.dm
index a095dc495f0..a6ae2e3628a 100644
--- a/code/game/machinery/computer/syndicate_specops_shuttle.dm
+++ b/code/game/machinery/computer/syndicate_specops_shuttle.dm
@@ -220,7 +220,7 @@ var/syndicate_elite_shuttle_timeleft = 0
/obj/machinery/computer/syndicate_elite_shuttle/Topic(href, href_list)
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
diff --git a/code/game/machinery/computer/telecrystalconsoles.dm b/code/game/machinery/computer/telecrystalconsoles.dm
index ae076b34349..4e49e677901 100644
--- a/code/game/machinery/computer/telecrystalconsoles.dm
+++ b/code/game/machinery/computer/telecrystalconsoles.dm
@@ -106,7 +106,7 @@ var/list/possible_uplinker_IDs = list("Alfa","Bravo","Charlie","Delta","Echo","F
/obj/machinery/computer/telecrystals/uplinker/Topic(href, href_list)
if(..())
- return
+ return 1
if(href_list["donate1"])
donateTC(1)
diff --git a/code/game/machinery/computer/xenos_shuttle.dm b/code/game/machinery/computer/xenos_shuttle.dm
index 1944274965a..5d5f921fdba 100644
--- a/code/game/machinery/computer/xenos_shuttle.dm
+++ b/code/game/machinery/computer/xenos_shuttle.dm
@@ -123,6 +123,9 @@
/obj/machinery/computer/xenos_station/Topic(href, href_list)
+ if(..())
+ return 1
+
if(!isliving(usr)) return
var/mob/living/user = usr
diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm
index 793ce4332fc..3a393c866bb 100644
--- a/code/game/machinery/cryo.dm
+++ b/code/game/machinery/cryo.dm
@@ -5,6 +5,7 @@
density = 1
anchored = 1.0
layer = 2.8
+ interact_offline = 1
var/on = 0
var/temperature_archived
diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index a1e21e3fad1..6f7018c1cf4 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -65,9 +65,8 @@
onclose(user, "cryopod_console")
/obj/machinery/computer/cryopod/Topic(href, href_list)
-
if(..())
- return
+ return 1
var/mob/user = usr
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 9ec64ff61c5..19980597308 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -695,16 +695,13 @@ About the new airlock wires panel:
//AI
//aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door, 8 door safties, 9 door speed, 11 emergency access
//aiEnable - 1 idscan, 4 raise door bolts, 5 electrify door for 30 seconds, 6 electrify door indefinitely, 7 open door, 8 door safties, 9 door speed, 11 emergency access
- if(!nowindow)
- ..()
- if(usr.stat || usr.restrained()|| usr.small)
- return
- add_fingerprint(usr)
+ if(..())
+ return 1
if(href_list["close"])
usr << browse(null, "window=airlock")
if(usr.machine==src)
usr.unset_machine()
- return
+ return 1
if((in_range(src, usr) && istype(src.loc, /turf)) && src.p_open)
usr.set_machine(src)
@@ -753,7 +750,7 @@ About the new airlock wires panel:
if(istype(usr, /mob/living/silicon))
if (!check_synth_access(usr))
- return
+ return 1
//AI
//aiDisable - 1 idscan, 2 disrupt main power, 3 disrupt backup power, 4 drop door bolts, 5 un-electrify door, 7 close door, 8 door safties, 9 door speed
@@ -943,7 +940,7 @@ About the new airlock wires panel:
update_icon()
if(!nowindow)
updateUsrDialog()
- return
+ return 0
/obj/machinery/door/airlock/attackby(C as obj, mob/user as mob)
//world << text("airlock attackby src [] obj [] mob []", src, C, user)
diff --git a/code/game/machinery/guestpass.dm b/code/game/machinery/guestpass.dm
index ee93ac74799..7acdc9e6fe2 100644
--- a/code/game/machinery/guestpass.dm
+++ b/code/game/machinery/guestpass.dm
@@ -105,7 +105,7 @@
/obj/machinery/computer/guestpass/Topic(href, href_list)
if(..())
- return
+ return 1
usr.set_machine(src)
if (href_list["mode"])
mode = text2num(href_list["mode"])
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index 94e0efa1e99..7d9eb50d44b 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -184,37 +184,65 @@ Class Procs:
use_power(active_power_usage,power_channel, 1)
return 1
-/obj/machinery/Topic(href, href_list)
- ..()
- if(!interact_offline && stat & (NOPOWER|BROKEN))
+/obj/machinery/Topic(href, href_list, var/nowindow = 0, var/checkrange = 1)
+ if(..())
return 1
- if(usr.restrained() || usr.lying || usr.stat)
+ if(!can_be_used_by(usr, be_close = checkrange))
return 1
- if ( ! (istype(usr, /mob/living/carbon/human) || \
- istype(usr, /mob/living/silicon) || \
- istype(usr, /mob/living/carbon/monkey) && ticker && ticker.mode.name == "monkey") )
- usr << "\red You don't have the dexterity to do this!"
- return 1
-
- var/norange = 0
- if(istype(usr, /mob/living/carbon/human))
- var/mob/living/carbon/human/H = usr
- if(istype(H.l_hand, /obj/item/tk_grab))
- norange = 1
- else if(istype(H.r_hand, /obj/item/tk_grab))
- norange = 1
-
- if(!norange)
- if ((!in_range(src, usr) || !istype(src.loc, /turf)) && !istype(usr, /mob/living/silicon))
- return 1
-
- src.add_fingerprint(usr)
-
- var/area/A = get_area(src)
- A.powerupdate = 1
-
+ add_fingerprint(usr)
return 0
+/obj/machinery/proc/can_be_used_by(mob/user, be_close = 1)
+ if(!interact_offline && stat & (NOPOWER|BROKEN))
+ return 0
+ if(!user.canUseTopic(src, be_close))
+ return 0
+ return 1
+
+////////////////////////////////////////////////////////////////////////////////////////////
+
+/mob/proc/canUseTopic(atom/movable/M, be_close = 1)
+ return
+
+/mob/dead/observer/canUseTopic(atom/movable/M, be_close = 1)
+ if(check_rights(R_ADMIN, 0))
+ return
+
+/mob/living/canUseTopic(atom/movable/M, be_close = 1, no_dextery = 0)
+ if(no_dextery)
+ src << "You don't have the dexterity to do this!"
+ return 0
+ return be_close && !in_range(M, src)
+
+/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close = 1)
+ if(restrained() || lying || stat || stunned || weakened)
+ return
+ if(be_close && !in_range(M, src))
+ if(M_TK in mutations)
+ var/mob/living/carbon/human/H = M
+ if(istype(H.l_hand, /obj/item/tk_grab) || istype(H.r_hand, /obj/item/tk_grab))
+ return 1
+ return
+ if(!isturf(M.loc) && M.loc != src)
+ return
+ return 1
+
+/mob/living/silicon/ai/canUseTopic(atom/movable/M)
+ if(stat)
+ return
+ //stop AIs from leaving windows open and using then after they lose vision
+ //apc_override is needed here because AIs use their own APC when powerless
+ if(cameranet && !cameranet.checkTurfVis(get_turf(M)) && !apc_override)
+ return
+ return 1
+
+/mob/living/silicon/robot/canUseTopic(atom/movable/M)
+ if(stat || lockcharge || stunned || weakened)
+ return
+ return 1
+
+////////////////////////////////////////////////////////////////////////////////////////////
+
/obj/machinery/attack_ai(var/mob/user as mob)
if(isAI(user))
var/mob/living/silicon/ai/A = user
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index fcb2412c122..1c7f8ee64a0 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -460,7 +460,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
/obj/machinery/newscaster/Topic(href, href_list)
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
if(href_list["set_channel_name"])
diff --git a/code/game/machinery/portable_turret.dm b/code/game/machinery/portable_turret.dm
index 84d6915556c..31da7e13203 100644
--- a/code/game/machinery/portable_turret.dm
+++ b/code/game/machinery/portable_turret.dm
@@ -233,7 +233,7 @@ Status: []
"},
/obj/machinery/porta_turret/Topic(href, href_list)
if (..())
- return
+ return 1
usr.set_machine(src)
src.add_fingerprint(usr)
if ((href_list["power"]) && (src.allowed(usr)))
diff --git a/code/game/machinery/programmable_unloader.dm b/code/game/machinery/programmable_unloader.dm
index c481d6fa32c..e7039af7f64 100644
--- a/code/game/machinery/programmable_unloader.dm
+++ b/code/game/machinery/programmable_unloader.dm
@@ -144,7 +144,7 @@
/obj/machinery/programmable/Topic(href, href_list)
if(..())
- return
+ return 1
usr.set_machine(src)
add_fingerprint(usr)
switch(href_list["operation"])
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index 1dd7024a41c..de3cf6964d6 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -120,8 +120,8 @@
Topic(href, href_list)
- if (usr.stat)
- return
+ if (..())
+ return 1
if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
diff --git a/code/game/machinery/suit_storage_unit.dm b/code/game/machinery/suit_storage_unit.dm
index 0b81ccabbeb..1b05e84fe9f 100644
--- a/code/game/machinery/suit_storage_unit.dm
+++ b/code/game/machinery/suit_storage_unit.dm
@@ -153,7 +153,7 @@
/obj/machinery/suit_storage_unit/Topic(href, href_list) //I fucking HATE this proc
if(..())
- return
+ return 1
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.set_machine(src)
if (href_list["toggleUV"])
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index a4cc791bff9..8cc2408c46c 100644
--- a/code/game/machinery/syndicatebeacon.dm
+++ b/code/game/machinery/syndicatebeacon.dm
@@ -39,6 +39,8 @@
onclose(user, "syndbeacon")
Topic(href, href_list)
+ if(..())
+ return 1
if(href_list["betraitor"])
if(charges < 1)
src.updateUsrDialog()
diff --git a/code/game/machinery/teleporter.dm b/code/game/machinery/teleporter.dm
index 9e18e2ce265..1aabc4b6d6d 100644
--- a/code/game/machinery/teleporter.dm
+++ b/code/game/machinery/teleporter.dm
@@ -93,7 +93,7 @@
/obj/machinery/computer/teleporter/Topic(href, href_list)
if(..())
- return
+ return 1
if(href_list["eject"])
eject()
diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm
index 507d0c1dfe7..4f77d7d7c70 100644
--- a/code/game/machinery/turrets.dm
+++ b/code/game/machinery/turrets.dm
@@ -462,7 +462,7 @@
/obj/machinery/turretid/Topic(href, href_list)
if(..())
- return
+ return 1
if (src.locked)
if (!istype(usr, /mob/living/silicon))
usr << "Control panel is locked!"
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 938af0c4cdc..a2b95fed050 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -397,7 +397,7 @@
/obj/machinery/vending/Topic(href, href_list)
if(..())
- return
+ return 1
if(istype(usr,/mob/living/silicon))
if(istype(usr,/mob/living/silicon/robot))
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index a2cec2ac512..e50de9f2d44 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -20,6 +20,12 @@
// What reagents should be logged when transferred TO this object?
// Reagent ID => friendly name
var/list/reagents_to_log=list()
+
+/obj/Topic(href, href_list, var/nowindow = 0)
+ // Calling Topic without a corresponding window open causes runtime errors
+ if(nowindow)
+ return 0
+ return ..()
/obj/Destroy()
machines -= src
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index f34da6c2e75..1fabedb239c 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -52,6 +52,7 @@ var/list/ai_list = list()
var/mob/living/silicon/ai/parent = null
+ var/apc_override = 0 //hack for letting the AI use its APC even when visionless
var/camera_light_on = 0 //Defines if the AI toggled the light on the camera it's looking through.
var/datum/trackable/track = null
var/can_shunt = 1
diff --git a/code/modules/mob/living/silicon/ai/life.dm b/code/modules/mob/living/silicon/ai/life.dm
index a4a0d5bdc28..477565b9cca 100644
--- a/code/modules/mob/living/silicon/ai/life.dm
+++ b/code/modules/mob/living/silicon/ai/life.dm
@@ -166,7 +166,9 @@
src << "Receiving control information from APC."
sleep(2)
//bring up APC dialog
+ apc_override = 1
theAPC.attack_ai(src)
+ apc_override = 0
src:aiRestorePowerRoutine = 3
src << "Here are your current laws:"
src.show_laws()
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index be181ff7515..6de3d9cea23 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -859,8 +859,11 @@
return !locked
/obj/machinery/power/apc/Topic(href, href_list, var/usingUI = 1)
+ if(..())
+ return 1
+
if(!can_use(usr, 1))
- return 0
+ return 1
if (href_list["lock"])
if(!is_authenticated(usr))
@@ -963,7 +966,7 @@
locked = !locked
update_icon()
- return 1
+ return 0
/obj/machinery/power/apc/proc/toggle_breaker()
operating = !operating
diff --git a/nano/templates/sec_camera.tmpl b/nano/templates/sec_camera.tmpl
index fb130a17d9e..b9764555cd6 100644
--- a/nano/templates/sec_camera.tmpl
+++ b/nano/templates/sec_camera.tmpl
@@ -31,8 +31,6 @@ Used In File(s): \code\game\machinery\computer\camera.dm