diff --git a/code/game/gamemodes/nuclear/nuclearbomb.dm b/code/game/gamemodes/nuclear/nuclearbomb.dm
index 21ba2762c75..0cd28bc76f2 100644
--- a/code/game/gamemodes/nuclear/nuclearbomb.dm
+++ b/code/game/gamemodes/nuclear/nuclearbomb.dm
@@ -88,78 +88,68 @@ var/bomb_set
src.extended = 1
/obj/machinery/nuclearbomb/Topic(href, href_list)
- ..()
- if (!usr.canmove || usr.stat || usr.restrained())
+ if(..())
return
- if (!ishuman(usr))
- usr << "\red You don't have the dexterity to do this!"
- return 1
- if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
- usr.set_machine(src)
- if (href_list["auth"])
- if (src.auth)
- src.auth.loc = src.loc
- src.yes_code = 0
- src.auth = null
- else
- var/obj/item/I = usr.get_active_hand()
- if (istype(I, /obj/item/weapon/disk/nuclear))
- usr.drop_item()
- I.loc = src
- src.auth = I
+ usr.set_machine(src)
+ if (href_list["auth"])
if (src.auth)
- if (href_list["type"])
- if (href_list["type"] == "E")
- if (src.code == src.r_code)
- src.yes_code = 1
- src.code = null
- else
- src.code = "ERROR"
+ src.auth.loc = src.loc
+ src.yes_code = 0
+ src.auth = null
+ else
+ var/obj/item/I = usr.get_active_hand()
+ if (istype(I, /obj/item/weapon/disk/nuclear))
+ usr.drop_item()
+ I.loc = src
+ src.auth = I
+ if (src.auth)
+ if (href_list["type"])
+ if (href_list["type"] == "E")
+ if (src.code == src.r_code)
+ src.yes_code = 1
+ src.code = null
else
- if (href_list["type"] == "R")
- src.yes_code = 0
- src.code = null
+ src.code = "ERROR"
+ else
+ if (href_list["type"] == "R")
+ src.yes_code = 0
+ src.code = null
+ else
+ src.code += text("[]", href_list["type"])
+ if (length(src.code) > 5)
+ src.code = "ERROR"
+ if (src.yes_code)
+ if (href_list["time"])
+ var/time = text2num(href_list["time"])
+ src.timeleft += time
+ src.timeleft = min(max(round(src.timeleft), 60), 600)
+ if (href_list["timer"])
+ if (src.timing == -1.0)
+ return
+ if (src.safety)
+ usr << "\red The safety is still on."
+ return
+ src.timing = !( src.timing )
+ if (src.timing)
+ src.icon_state = "nuclearbomb2"
+ if(!src.safety)
+ bomb_set = 1//There can still be issues with this reseting when there are multiple bombs. Not a big deal tho for Nuke/N
else
- src.code += text("[]", href_list["type"])
- if (length(src.code) > 5)
- src.code = "ERROR"
- if (src.yes_code)
- if (href_list["time"])
- var/time = text2num(href_list["time"])
- src.timeleft += time
- src.timeleft = min(max(round(src.timeleft), 60), 600)
- if (href_list["timer"])
- if (src.timing == -1.0)
- return
- if (src.safety)
- usr << "\red The safety is still on."
- return
- src.timing = !( src.timing )
- if (src.timing)
- src.icon_state = "nuclearbomb2"
- if(!src.safety)
- bomb_set = 1//There can still be issues with this reseting when there are multiple bombs. Not a big deal tho for Nuke/N
- else
- bomb_set = 0
- else
- src.icon_state = "nuclearbomb1"
bomb_set = 0
- if (href_list["safety"])
- src.safety = !( src.safety )
- if(safety)
- src.timing = 0
- bomb_set = 0
- if (href_list["anchor"])
- src.anchored = !( src.anchored )
- src.add_fingerprint(usr)
- for(var/mob/M in viewers(1, src))
- if ((M.client && M.machine == src))
- src.attack_hand(M)
- else
- usr << browse(null, "window=nuclearbomb")
- return
- return
-
+ else
+ src.icon_state = "nuclearbomb1"
+ bomb_set = 0
+ if (href_list["safety"])
+ src.safety = !( src.safety )
+ if(safety)
+ src.timing = 0
+ bomb_set = 0
+ if (href_list["anchor"])
+ src.anchored = !( src.anchored )
+ src.add_fingerprint(usr)
+ for(var/mob/M in viewers(1, src))
+ if ((M.client && M.machine == src))
+ src.attack_hand(M)
/obj/machinery/nuclearbomb/ex_act(severity)
return
diff --git a/code/game/machinery/Freezer.dm b/code/game/machinery/Freezer.dm
index baba7988bf5..858553c02a1 100644
--- a/code/game/machinery/Freezer.dm
+++ b/code/game/machinery/Freezer.dm
@@ -66,20 +66,19 @@
popup.open()
Topic(href, href_list)
- 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["start"])
- src.on = !src.on
- update_icon()
- if(href_list["temp"])
- var/amount = text2num(href_list["temp"])
- if(amount > 0)
- src.current_temperature = min(T20C, src.current_temperature+amount)
- else
- src.current_temperature = max((T0C - 200), src.current_temperature+amount)
+ if(..())
+ return
+ usr.set_machine(src)
+ if (href_list["start"])
+ src.on = !src.on
+ update_icon()
+ if(href_list["temp"])
+ var/amount = text2num(href_list["temp"])
+ if(amount > 0)
+ src.current_temperature = min(T20C, src.current_temperature+amount)
+ else
+ src.current_temperature = max((T0C - 200), src.current_temperature+amount)
src.updateUsrDialog()
- src.add_fingerprint(usr)
- return
process()
..()
@@ -150,6 +149,8 @@
onclose(user, "heater")
Topic(href, href_list)
+ if(..())
+ return
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["start"])
diff --git a/code/game/machinery/ai_slipper.dm b/code/game/machinery/ai_slipper.dm
index 08f138d19d5..87e4b8d6098 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
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 cb70435fd00..728d0e63039 100644
--- a/code/game/machinery/alarm.dm
+++ b/code/game/machinery/alarm.dm
@@ -520,7 +520,6 @@ table tr:first-child th:first-child { border: none;}
/obj/machinery/alarm/Topic(href, href_list)
if(..())
return
- src.add_fingerprint(usr)
usr.set_machine(src)
if ( (get_dist(src, usr) > 1 ))
@@ -1113,35 +1112,27 @@ FIRE ALARM
return
/obj/machinery/firealarm/Topic(href, href_list)
- ..()
- if (usr.stat || stat & (BROKEN|NOPOWER))
+ if(..())
return
if (buildstage != 2)
return
- 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["reset"])
- src.reset()
- else if (href_list["alarm"])
- src.alarm()
- else if (href_list["time"])
- src.timing = text2num(href_list["time"])
- last_process = world.timeofday
- processing_objects.Add(src)
- else if (href_list["tp"])
- var/tp = text2num(href_list["tp"])
- src.time += tp
- src.time = min(max(round(src.time), 0), 120)
+ usr.set_machine(src)
+ if (href_list["reset"])
+ src.reset()
+ else if (href_list["alarm"])
+ src.alarm()
+ else if (href_list["time"])
+ src.timing = text2num(href_list["time"])
+ last_process = world.timeofday
+ processing_objects.Add(src)
+ else if (href_list["tp"])
+ var/tp = text2num(href_list["tp"])
+ src.time += tp
+ src.time = min(max(round(src.time), 0), 120)
- src.updateUsrDialog()
-
- src.add_fingerprint(usr)
- else
- usr << browse(null, "window=firealarm")
- return
- return
+ src.updateUsrDialog()
/obj/machinery/firealarm/proc/reset()
if (!( src.working ))
@@ -1333,7 +1324,8 @@ Code shamelessly copied from apc_frame
return
/obj/machinery/partyalarm/Topic(href, href_list)
- ..()
+ if(..())
+ return
if (usr.stat || stat & (BROKEN|NOPOWER))
return
if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
diff --git a/code/game/machinery/bots/secbot.dm b/code/game/machinery/bots/secbot.dm
index 8d08f44641f..15b484f1b7b 100644
--- a/code/game/machinery/bots/secbot.dm
+++ b/code/game/machinery/bots/secbot.dm
@@ -132,8 +132,9 @@ Auto Patrol: []"},
return
/obj/machinery/bot/secbot/Topic(href, href_list)
+ if(..())
+ return
usr.set_machine(src)
- src.add_fingerprint(usr)
if((href_list["power"]) && (src.allowed(usr)))
if(src.on)
turn_off()
diff --git a/code/game/machinery/computer/power.dm b/code/game/machinery/computer/power.dm
index dcbf492551d..4c841e12734 100644
--- a/code/game/machinery/computer/power.dm
+++ b/code/game/machinery/computer/power.dm
@@ -118,7 +118,8 @@
popup.open()
/obj/machinery/power/monitor/Topic(href, href_list)
- ..()
+ if(..())
+ return
if( href_list["close"] )
usr << browse(null, "window=powcomp")
usr.unset_machine()
diff --git a/code/game/machinery/computer/syndicate_shuttle.dm b/code/game/machinery/computer/syndicate_shuttle.dm
index 2223456e08b..febb48eb700 100644
--- a/code/game/machinery/computer/syndicate_shuttle.dm
+++ b/code/game/machinery/computer/syndicate_shuttle.dm
@@ -70,11 +70,12 @@
/obj/machinery/computer/syndicate_station/Topic(href, href_list)
- if(!isliving(usr)) return
+ if(..())
+ return
+
var/mob/living/user = usr
- if(in_range(src, user) || istype(user, /mob/living/silicon))
- user.set_machine(src)
+ user.set_machine(src)
if(href_list["syndicate"])
syndicate_move_to(/area/syndicate_station/start)
@@ -95,7 +96,6 @@
else if(href_list["mining"])
syndicate_move_to(/area/syndicate_station/mining)
- add_fingerprint(usr)
updateUsrDialog()
return
diff --git a/code/game/machinery/cryo.dm b/code/game/machinery/cryo.dm
index 5178d32db8f..4634fd0eb9c 100644
--- a/code/game/machinery/cryo.dm
+++ b/code/game/machinery/cryo.dm
@@ -128,19 +128,18 @@
/obj/machinery/atmospherics/unary/cryo_cell/Topic(href, href_list)
- if((get_dist(src, usr) <= 1) || istype(usr, /mob/living/silicon/ai))
- if(href_list["start"])
- on = !on
- update_icon()
- if(href_list["eject"])
- if(beaker)
- var/obj/item/weapon/reagent_containers/glass/B = beaker
- B.loc = get_step(loc, SOUTH)
- beaker = null
-
- updateUsrDialog()
- add_fingerprint(usr)
+ if(..())
+ return
+ if(href_list["start"])
+ on = !on
+ update_icon()
+ if(href_list["eject"])
+ if(beaker)
+ var/obj/item/weapon/reagent_containers/glass/B = beaker
+ B.loc = get_step(loc, SOUTH)
+ beaker = null
+ updateUsrDialog()
/obj/machinery/atmospherics/unary/cryo_cell/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/reagent_containers/glass))
diff --git a/code/game/machinery/magnet.dm b/code/game/machinery/magnet.dm
index a2dd432d991..cb7dc75e7d4 100644
--- a/code/game/machinery/magnet.dm
+++ b/code/game/machinery/magnet.dm
@@ -275,10 +275,9 @@
onclose(user, "magnet")
Topic(href, href_list)
- if(stat & (BROKEN|NOPOWER))
+ if(..())
return
usr.set_machine(src)
- src.add_fingerprint(usr)
if(href_list["radio-op"])
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 71f450e70fe..55eac77d77f 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -181,63 +181,61 @@ Transponder Codes:
"}
return
Topic(href, href_list)
- ..()
- if (usr.stat)
+ if(..())
return
- if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
- if(open && !locked)
- usr.set_machine(src)
+ if(open && !locked)
+ usr.set_machine(src)
- if (href_list["freq"])
- freq = sanitize_frequency(freq + text2num(href_list["freq"]))
+ if (href_list["freq"])
+ freq = sanitize_frequency(freq + text2num(href_list["freq"]))
+ updateDialog()
+
+ else if(href_list["locedit"])
+ var/newloc = copytext(sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null),1,MAX_MESSAGE_LEN)
+ if(newloc)
+ location = newloc
updateDialog()
- else if(href_list["locedit"])
- var/newloc = copytext(sanitize(input("Enter New Location", "Navigation Beacon", location) as text|null),1,MAX_MESSAGE_LEN)
- if(newloc)
- location = newloc
- updateDialog()
+ else if(href_list["edit"])
+ var/codekey = href_list["code"]
- else if(href_list["edit"])
- var/codekey = href_list["code"]
+ var/newkey = input("Enter Transponder Code Key", "Navigation Beacon", codekey) as text|null
+ if(!newkey)
+ return
- var/newkey = input("Enter Transponder Code Key", "Navigation Beacon", codekey) as text|null
- if(!newkey)
- return
+ var/codeval = codes[codekey]
+ var/newval = input("Enter Transponder Code Value", "Navigation Beacon", codeval) as text|null
+ if(!newval)
+ newval = codekey
+ return
- var/codeval = codes[codekey]
- var/newval = input("Enter Transponder Code Value", "Navigation Beacon", codeval) as text|null
- if(!newval)
- newval = codekey
- return
+ codes.Remove(codekey)
+ codes[newkey] = newval
- codes.Remove(codekey)
- codes[newkey] = newval
+ updateDialog()
- updateDialog()
+ else if(href_list["delete"])
+ var/codekey = href_list["code"]
+ codes.Remove(codekey)
+ updateDialog()
- else if(href_list["delete"])
- var/codekey = href_list["code"]
- codes.Remove(codekey)
- updateDialog()
+ else if(href_list["add"])
- else if(href_list["add"])
+ var/newkey = input("Enter New Transponder Code Key", "Navigation Beacon") as text|null
+ if(!newkey)
+ return
- var/newkey = input("Enter New Transponder Code Key", "Navigation Beacon") as text|null
- if(!newkey)
- return
+ var/newval = input("Enter New Transponder Code Value", "Navigation Beacon") as text|null
+ if(!newval)
+ newval = "1"
+ return
- var/newval = input("Enter New Transponder Code Value", "Navigation Beacon") as text|null
- if(!newval)
- newval = "1"
- return
+ if(!codes)
+ codes = new()
- if(!codes)
- codes = new()
+ codes[newkey] = newval
- codes[newkey] = newval
-
- updateDialog()
+ updateDialog()
diff --git a/code/game/machinery/spaceheater.dm b/code/game/machinery/spaceheater.dm
index f1602ae1f75..37ff4693371 100644
--- a/code/game/machinery/spaceheater.dm
+++ b/code/game/machinery/spaceheater.dm
@@ -116,45 +116,39 @@
Topic(href, href_list)
- if (usr.stat)
+ if(..())
return
- if ((in_range(src, usr) && istype(src.loc, /turf)) || (istype(usr, /mob/living/silicon)))
- usr.set_machine(src)
+ usr.set_machine(src)
- switch(href_list["op"])
+ switch(href_list["op"])
- if("temp")
- var/value = text2num(href_list["val"])
+ if("temp")
+ var/value = text2num(href_list["val"])
- // limit to 20-90 degC
- set_temperature = dd_range(20, 90, set_temperature + value)
+ // limit to 20-90 degC
+ set_temperature = dd_range(20, 90, set_temperature + value)
- if("cellremove")
- if(open && cell && !usr.get_active_hand())
- cell.updateicon()
- usr.put_in_hands(cell)
- cell.add_fingerprint(usr)
- cell = null
- usr.visible_message("\blue [usr] removes the power cell from \the [src].", "\blue You remove the power cell from \the [src].")
+ if("cellremove")
+ if(open && cell && !usr.get_active_hand())
+ cell.updateicon()
+ usr.put_in_hands(cell)
+ cell.add_fingerprint(usr)
+ cell = null
+ usr.visible_message("\blue [usr] removes the power cell from \the [src].", "\blue You remove the power cell from \the [src].")
- if("cellinstall")
- if(open && !cell)
- var/obj/item/weapon/cell/C = usr.get_active_hand()
- if(istype(C))
- usr.drop_item()
- cell = C
- C.loc = src
- C.add_fingerprint(usr)
+ if("cellinstall")
+ if(open && !cell)
+ var/obj/item/weapon/cell/C = usr.get_active_hand()
+ if(istype(C))
+ usr.drop_item()
+ cell = C
+ C.loc = src
+ C.add_fingerprint(usr)
- usr.visible_message("\blue [usr] inserts a power cell into \the [src].", "\blue You insert the power cell into \the [src].")
-
- updateDialog()
- else
- usr << browse(null, "window=spaceheater")
- usr.unset_machine()
- return
+ usr.visible_message("\blue [usr] inserts a power cell into \the [src].", "\blue You insert the power cell into \the [src].")
+ updateDialog()
process()
diff --git a/code/game/machinery/syndicatebeacon.dm b/code/game/machinery/syndicatebeacon.dm
index 9eda9ed65a4..ddedae35197 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
if(href_list["betraitor"])
if(charges < 1)
src.updateUsrDialog()
@@ -90,7 +92,6 @@
M << "Objective #[obj_count]: [OBJ.explanation_text]"
obj_count++
- src.add_fingerprint(usr)
src.updateUsrDialog()
return
diff --git a/code/game/machinery/telecomms/machine_interactions.dm b/code/game/machinery/telecomms/machine_interactions.dm
index 814a1c636d4..cc8d47bd6cc 100644
--- a/code/game/machinery/telecomms/machine_interactions.dm
+++ b/code/game/machinery/telecomms/machine_interactions.dm
@@ -275,14 +275,13 @@
/obj/machinery/telecomms/Topic(href, href_list)
+ if(..())
+ return
if(!issilicon(usr))
if(!istype(usr.get_active_hand(), /obj/item/device/multitool))
return
- if(stat & (BROKEN|NOPOWER))
- return
-
var/obj/item/device/multitool/P = get_multitool(usr)
if(href_list["input"])
@@ -384,7 +383,6 @@
src.Options_Topic(href, href_list)
usr.set_machine(src)
- src.add_fingerprint(usr)
updateUsrDialog()
diff --git a/code/game/machinery/turrets.dm b/code/game/machinery/turrets.dm
index 3a50e4ef09d..9d98e63a299 100644
--- a/code/game/machinery/turrets.dm
+++ b/code/game/machinery/turrets.dm
@@ -434,18 +434,18 @@
/obj/machinery/turretid/Topic(href, href_list)
- ..()
+ if(..())
+ return
if (src.locked)
if (!istype(usr, /mob/living/silicon))
usr << "Control panel is locked!"
return
- if ( get_dist(src, usr) == 0 || issilicon(usr))
- if (href_list["toggleOn"])
- src.enabled = !src.enabled
- src.updateTurrets()
- else if (href_list["toggleLethal"])
- src.lethal = !src.lethal
- src.updateTurrets()
+ if (href_list["toggleOn"])
+ src.enabled = !src.enabled
+ src.updateTurrets()
+ else if (href_list["toggleLethal"])
+ src.lethal = !src.lethal
+ src.updateTurrets()
src.attack_hand(usr)
/obj/machinery/turretid/proc/updateTurrets()
diff --git a/code/game/machinery/vending.dm b/code/game/machinery/vending.dm
index 7ad57913d2a..0bad93e04f0 100644
--- a/code/game/machinery/vending.dm
+++ b/code/game/machinery/vending.dm
@@ -203,9 +203,7 @@
/obj/machinery/vending/Topic(href, href_list)
- if(stat & (BROKEN|NOPOWER))
- return
- if(usr.stat || usr.restrained())
+ if(..())
return
@@ -232,59 +230,55 @@
coin = null
- if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))))
- usr.set_machine(src)
- if((href_list["vend"]) && (vend_ready))
+ usr.set_machine(src)
+ if((href_list["vend"]) && (vend_ready))
- if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
- usr << "Access denied." //Unless emagged of course
- flick(icon_deny,src)
- return
-
- vend_ready = 0 //One thing at a time!!
-
- var/datum/data/vending_product/R = locate(href_list["vend"])
- if(!R || !istype(R) || !R.product_path || R.amount <= 0)
- vend_ready = 1
- return
-
- if(R in coin_records)
- if(!coin)
- usr << "You need to insert a coin to get this item."
- return
- if(coin.string_attached)
- if(prob(50))
- usr << "You successfully pull the coin out before [src] could swallow it."
- else
- usr << "You weren't able to pull the coin out fast enough, the machine ate it, string and all."
- del(coin)
- else
- del(coin)
-
- R.amount--
-
- if(((last_reply + (vend_delay + 200)) <= world.time) && vend_reply)
- speak(vend_reply)
- last_reply = world.time
-
- use_power(5)
- if(icon_vend) //Show the vending animation if needed
- flick(icon_vend,src)
- spawn(vend_delay)
- new R.product_path(get_turf(src))
- vend_ready = 1
- return
-
- updateUsrDialog()
+ if((!allowed(usr)) && !emagged && scan_id) //For SECURE VENDING MACHINES YEAH
+ usr << "Access denied." //Unless emagged of course
+ flick(icon_deny,src)
return
- else if(href_list["togglevoice"] && panel_open)
- shut_up = !shut_up
+ vend_ready = 0 //One thing at a time!!
+
+ var/datum/data/vending_product/R = locate(href_list["vend"])
+ if(!R || !istype(R) || !R.product_path || R.amount <= 0)
+ vend_ready = 1
+ return
+
+ if(R in coin_records)
+ if(!coin)
+ usr << "You need to insert a coin to get this item."
+ return
+ if(coin.string_attached)
+ if(prob(50))
+ usr << "You successfully pull the coin out before [src] could swallow it."
+ else
+ usr << "You weren't able to pull the coin out fast enough, the machine ate it, string and all."
+ del(coin)
+ else
+ del(coin)
+
+ R.amount--
+
+ if(((last_reply + (vend_delay + 200)) <= world.time) && vend_reply)
+ speak(vend_reply)
+ last_reply = world.time
+
+ use_power(5)
+ if(icon_vend) //Show the vending animation if needed
+ flick(icon_vend,src)
+ spawn(vend_delay)
+ new R.product_path(get_turf(src))
+ vend_ready = 1
+ return
- add_fingerprint(usr)
updateUsrDialog()
- else
- usr << browse(null, "window=vending")
+ return
+
+ else if(href_list["togglevoice"] && panel_open)
+ shut_up = !shut_up
+
+ updateUsrDialog()
/obj/machinery/vending/process()
diff --git a/code/game/mecha/mech_bay.dm b/code/game/mecha/mech_bay.dm
index 85cd6f75d13..76105d6bd81 100644
--- a/code/game/mecha/mech_bay.dm
+++ b/code/game/mecha/mech_bay.dm
@@ -208,6 +208,8 @@
Topic(href, href_list)
+ if(..())
+ return
if(href_list["autostart"])
autostart = !autostart
if(href_list["voltage"])
diff --git a/code/game/mecha/mech_fabricator.dm b/code/game/mecha/mech_fabricator.dm
index 8bf093cf18b..d992d64cf36 100644
--- a/code/game/mecha/mech_fabricator.dm
+++ b/code/game/mecha/mech_fabricator.dm
@@ -598,7 +598,8 @@
/obj/machinery/mecha_part_fabricator/Topic(href, href_list)
- ..()
+ if(..())
+ return
var/datum/topic_input/filter = new /datum/topic_input(href,href_list)
if(href_list["part_set"])
var/tpart_set = filter.getStr("part_set")
diff --git a/code/game/objects/items/weapons/implants/implantchair.dm b/code/game/objects/items/weapons/implants/implantchair.dm
index 0edd1a87362..7b2b7197743 100644
--- a/code/game/objects/items/weapons/implants/implantchair.dm
+++ b/code/game/objects/items/weapons/implants/implantchair.dm
@@ -54,24 +54,24 @@
Topic(href, href_list)
- if((get_dist(src, usr) <= 1) || istype(usr, /mob/living/silicon/ai))
- if(href_list["implant"])
- if(src.occupant)
- injecting = 1
- go_out()
- ready = 0
- spawn(injection_cooldown)
- ready = 1
-
- if(href_list["replenish"])
+ if(..())
+ return
+ if(href_list["implant"])
+ if(src.occupant)
+ injecting = 1
+ go_out()
ready = 0
- spawn(replenish_cooldown)
- add_implants()
+ spawn(injection_cooldown)
ready = 1
- src.updateUsrDialog()
- src.add_fingerprint(usr)
- return
+ if(href_list["replenish"])
+ ready = 0
+ spawn(replenish_cooldown)
+ add_implants()
+ ready = 1
+
+ src.updateUsrDialog()
+ return
attackby(var/obj/item/weapon/G as obj, var/mob/user as mob)
diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm
index 06dfa6b5bcf..32fadf2eef7 100644
--- a/code/modules/awaymissions/bluespaceartillery.dm
+++ b/code/modules/awaymissions/bluespaceartillery.dm
@@ -32,24 +32,22 @@
return
/obj/machinery/artillerycontrol/Topic(href, href_list)
- ..()
- if (usr.stat || usr.restrained())
+ if(..())
return
+ var/A
+ A = input("Area to jump bombard", "Open Fire", A) in teleportlocs
+ var/area/thearea = teleportlocs[A]
+ if (usr.stat || usr.restrained()) return
+ if(src.reload < 180) return
if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
- var/A
- A = input("Area to jump bombard", "Open Fire", A) in teleportlocs
- var/area/thearea = teleportlocs[A]
- if (usr.stat || usr.restrained()) return
- if(src.reload < 180) return
- if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
- command_alert("Bluespace artillery fire detected. Brace for impact.")
- message_admins("[key_name_admin(usr)] has launched an artillery strike.", 1)
- var/list/L = list()
- for(var/turf/T in get_area_turfs(thearea.type))
- L+=T
- var/loc = pick(L)
- explosion(loc,2,5,11)
- reload = 0
+ command_alert("Bluespace artillery fire detected. Brace for impact.")
+ message_admins("[key_name_admin(usr)] has launched an artillery strike.", 1)
+ var/list/L = list()
+ for(var/turf/T in get_area_turfs(thearea.type))
+ L+=T
+ var/loc = pick(L)
+ explosion(loc,2,5,11)
+ reload = 0
/*mob/proc/openfire()
var/A
diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm
index f39d416b9df..32489d54163 100644
--- a/code/modules/hydroponics/biogenerator.dm
+++ b/code/modules/hydroponics/biogenerator.dm
@@ -220,9 +220,8 @@
return 1
/obj/machinery/biogenerator/Topic(href, href_list)
- if(stat & BROKEN) return
- if(usr.stat || usr.restrained()) return
- if(!in_range(src, usr)) return
+ if(..())
+ return
usr.set_machine(src)
diff --git a/code/modules/paperwork/photocopier.dm b/code/modules/paperwork/photocopier.dm
index 2d429326933..d9aa009b1e3 100644
--- a/code/modules/paperwork/photocopier.dm
+++ b/code/modules/paperwork/photocopier.dm
@@ -52,6 +52,8 @@
onclose(user, "copier")
/obj/machinery/photocopier/Topic(href, href_list)
+ if(..())
+ return
if(href_list["copy"])
if(copy)
for(var/i = 0, i < copies, i++)
diff --git a/code/modules/power/antimatter/control.dm b/code/modules/power/antimatter/control.dm
index 61c6cabb92e..88c73bef02e 100644
--- a/code/modules/power/antimatter/control.dm
+++ b/code/modules/power/antimatter/control.dm
@@ -300,11 +300,7 @@
/obj/machinery/power/am_control_unit/Topic(href, href_list)
- ..()
- //Ignore input if we are broken or guy is not touching us, AI can control from a ways away
- if(stat & (BROKEN|NOPOWER) || (get_dist(src, usr) > 1 && !istype(usr, /mob/living/silicon/ai)))
- usr.unset_machine()
- usr << browse(null, "window=AMcontrol")
+ if(..())
return
if(href_list["close"])
diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm
index f4968a9d6c6..0540b9f637d 100644
--- a/code/modules/power/apc.dm
+++ b/code/modules/power/apc.dm
@@ -694,11 +694,12 @@
return 1
/obj/machinery/power/apc/Topic(href, href_list, var/usingUI = 1)
+ if(..())
+ return
if(!isrobot(usr))
if(!can_use(usr, 1))
return
- src.add_fingerprint(usr)
usr.set_machine(src)
if (href_list["lock"])
diff --git a/code/modules/power/generator.dm b/code/modules/power/generator.dm
index 0d1aad17c71..d3e9ff828e3 100644
--- a/code/modules/power/generator.dm
+++ b/code/modules/power/generator.dm
@@ -151,7 +151,8 @@
/obj/machinery/power/generator/Topic(href, href_list)
- ..()
+ if(..())
+ return
if( href_list["close"] )
usr << browse(null, "window=teg")
usr.unset_machine()
diff --git a/code/modules/power/generator_type2.dm b/code/modules/power/generator_type2.dm
index 4c3db8bc3f9..3c88b3eeecb 100644
--- a/code/modules/power/generator_type2.dm
+++ b/code/modules/power/generator_type2.dm
@@ -128,7 +128,8 @@
/obj/machinery/power/generator_type2/Topic(href, href_list)
- ..()
+ if(..())
+ return
if( href_list["close"] )
usr << browse(null, "window=teg")
diff --git a/code/modules/power/gravitygenerator.dm b/code/modules/power/gravitygenerator.dm
index b22c0a7e7c5..5727562ef6d 100644
--- a/code/modules/power/gravitygenerator.dm
+++ b/code/modules/power/gravitygenerator.dm
@@ -114,13 +114,9 @@
/obj/machinery/computer/gravity_control_computer/Topic(href, href_list)
set background = 1
- ..()
- if ( (get_dist(src, usr) > 1 ))
- if (!istype(usr, /mob/living/silicon))
- usr.unset_machine()
- usr << browse(null, "window=air_alarm")
- return
+ if(..())
+ return
if(href_list["gentoggle"])
if(gravity_generator:on)
diff --git a/code/modules/power/singularity/particle_accelerator/particle_control.dm b/code/modules/power/singularity/particle_accelerator/particle_control.dm
index 8d92a3facfd..436dda7c594 100644
--- a/code/modules/power/singularity/particle_accelerator/particle_control.dm
+++ b/code/modules/power/singularity/particle_accelerator/particle_control.dm
@@ -73,11 +73,7 @@
return
/obj/machinery/particle_accelerator/control_box/Topic(href, href_list)
- ..()
- //Ignore input if we are broken, !silicon guy cant touch us, or nonai controlling from super far away
- if(stat & (BROKEN|NOPOWER) || (get_dist(src, usr) > 1 && !istype(usr, /mob/living/silicon)) || (get_dist(src, usr) > 8 && !istype(usr, /mob/living/silicon/ai)))
- usr.unset_machine()
- usr << browse(null, "window=pacontrol")
+ if(..())
return
if(!interface_control)
diff --git a/code/modules/power/smes.dm b/code/modules/power/smes.dm
index 13ebccd4f0d..cbb9ccb90d1 100644
--- a/code/modules/power/smes.dm
+++ b/code/modules/power/smes.dm
@@ -210,96 +210,82 @@
/obj/machinery/power/smes/Topic(href, href_list)
- ..()
-
- if (usr.stat || usr.restrained() )
+ if(..())
return
- if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
- if(!istype(usr, /mob/living/silicon/ai))
- usr << "\red You don't have the dexterity to do this!"
- return
//world << "[href] ; [href_list[href]]"
- if (( usr.machine==src && ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
+ if( href_list["close"] )
+ usr << browse(null, "window=smes")
+ usr.unset_machine()
+ return
+ else if( href_list["cmode"] )
+ chargemode = !chargemode
+ if(!chargemode)
+ charging = 0
+ updateicon()
- if( href_list["close"] )
- usr << browse(null, "window=smes")
- usr.unset_machine()
- return
+ else if( href_list["online"] )
+ online = !online
+ updateicon()
+ else if( href_list["input"] )
- else if( href_list["cmode"] )
- chargemode = !chargemode
- if(!chargemode)
- charging = 0
- updateicon()
+ var/i = text2num(href_list["input"])
- else if( href_list["online"] )
- online = !online
- updateicon()
- else if( href_list["input"] )
+ var/d = 0
+ switch(i)
+ if(-4)
+ chargelevel = 0
+ if(4)
+ chargelevel = SMESMAXCHARGELEVEL //30000
- var/i = text2num(href_list["input"])
+ if(1)
+ d = 100
+ if(-1)
+ d = -100
+ if(2)
+ d = 1000
+ if(-2)
+ d = -1000
+ if(3)
+ d = 10000
+ if(-3)
+ d = -10000
- var/d = 0
- switch(i)
- if(-4)
- chargelevel = 0
- if(4)
- chargelevel = SMESMAXCHARGELEVEL //30000
+ chargelevel += d
+ chargelevel = max(0, min(SMESMAXCHARGELEVEL, chargelevel)) // clamp to range
- if(1)
- d = 100
- if(-1)
- d = -100
- if(2)
- d = 1000
- if(-2)
- d = -1000
- if(3)
- d = 10000
- if(-3)
- d = -10000
+ else if( href_list["output"] )
- chargelevel += d
- chargelevel = max(0, min(SMESMAXCHARGELEVEL, chargelevel)) // clamp to range
+ var/i = text2num(href_list["output"])
- else if( href_list["output"] )
+ var/d = 0
+ switch(i)
+ if(-4)
+ output = 0
+ if(4)
+ output = SMESMAXOUTPUT //30000
- var/i = text2num(href_list["output"])
+ if(1)
+ d = 100
+ if(-1)
+ d = -100
+ if(2)
+ d = 1000
+ if(-2)
+ d = -1000
+ if(3)
+ d = 10000
+ if(-3)
+ d = -10000
- var/d = 0
- switch(i)
- if(-4)
- output = 0
- if(4)
- output = SMESMAXOUTPUT //30000
-
- if(1)
- d = 100
- if(-1)
- d = -100
- if(2)
- d = 1000
- if(-2)
- d = -1000
- if(3)
- d = 10000
- if(-3)
- d = -10000
-
- output += d
- output = max(0, min(SMESMAXOUTPUT, output)) // clamp to range
+ output += d
+ output = max(0, min(SMESMAXOUTPUT, output)) // clamp to range
investigate_log("input/output; [chargelevel>output?"":""][chargelevel]/[output] | Output-mode: [online?"on":"off"] | Input-mode: [chargemode?"auto":"off"] by [usr.key]","singulo")
src.updateUsrDialog()
- else
- usr << browse(null, "window=smes")
- usr.unset_machine()
- return
-
/obj/machinery/power/smes/proc/ion_act()
if(src.z == 1)
diff --git a/code/modules/power/turbine.dm b/code/modules/power/turbine.dm
index fbb5d216789..f39e18acdc9 100644
--- a/code/modules/power/turbine.dm
+++ b/code/modules/power/turbine.dm
@@ -185,39 +185,21 @@
return
/obj/machinery/power/turbine/Topic(href, href_list)
- ..()
- if(stat & BROKEN)
+ if(..())
return
- if (usr.stat || usr.restrained() )
- return
- if (!(istype(usr, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
- if(!istype(usr, /mob/living/silicon/ai))
- usr << "\red You don't have the dexterity to do this!"
- return
- if (( usr.machine==src && ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
-
-
- if( href_list["close"] )
- usr << browse(null, "window=turbine")
- usr.machine = null
- return
-
- else if( href_list["str"] )
- compressor.starter = !compressor.starter
-
- spawn(0)
- for(var/mob/M in viewers(1, src))
- if ((M.client && M.machine == src))
- src.interact(M)
-
- else
+ if( href_list["close"] )
usr << browse(null, "window=turbine")
usr.machine = null
+ return
- return
-
+ else if( href_list["str"] )
+ compressor.starter = !compressor.starter
+ spawn(0)
+ for(var/mob/M in viewers(1, src))
+ if ((M.client && M.machine == src))
+ src.interact(M)
diff --git a/code/modules/reagents/Chemistry-Machinery.dm b/code/modules/reagents/Chemistry-Machinery.dm
index 964ff592f45..68749795260 100644
--- a/code/modules/reagents/Chemistry-Machinery.dm
+++ b/code/modules/reagents/Chemistry-Machinery.dm
@@ -243,11 +243,9 @@
return
/obj/machinery/chem_master/Topic(href, href_list)
- if(stat & (BROKEN|NOPOWER)) return
- if(usr.stat || usr.restrained()) return
- if(!in_range(src, usr)) return
+ if(..())
+ return
- src.add_fingerprint(usr)
usr.set_machine(src)
diff --git a/code/modules/recycling/disposal.dm b/code/modules/recycling/disposal.dm
index ead4e2c1937..65a17cef02a 100644
--- a/code/modules/recycling/disposal.dm
+++ b/code/modules/recycling/disposal.dm
@@ -259,6 +259,8 @@
// handle machine interaction
Topic(href, href_list)
+ if(..())
+ return
if(usr.loc == src)
usr << "\red You cannot reach the controls from inside."
return
@@ -267,37 +269,26 @@
usr << "\red The disposal units power is disabled."
return
..()
- src.add_fingerprint(usr)
- if(stat & BROKEN)
- return
- if(usr.stat || usr.restrained() || src.flushing)
- return
+ usr.set_machine(src)
- if (in_range(src, usr) && istype(src.loc, /turf))
- usr.set_machine(src)
-
- if(href_list["close"])
- usr.unset_machine()
- usr << browse(null, "window=disposal")
- return
-
- if(href_list["pump"])
- if(text2num(href_list["pump"]))
- mode = 1
- else
- mode = 0
- update()
-
- if(href_list["handle"])
- flush = text2num(href_list["handle"])
- update()
-
- if(href_list["eject"])
- eject()
- else
- usr << browse(null, "window=disposal")
+ if(href_list["close"])
usr.unset_machine()
+ usr << browse(null, "window=disposal")
return
+
+ if(href_list["pump"])
+ if(text2num(href_list["pump"]))
+ mode = 1
+ else
+ mode = 0
+ update()
+
+ if(href_list["handle"])
+ flush = text2num(href_list["handle"])
+ update()
+
+ if(href_list["eject"])
+ eject()
return
// eject the contents of the disposal unit
diff --git a/code/modules/security levels/keycard authentication.dm b/code/modules/security levels/keycard authentication.dm
index c42aec969ae..85da9d23780 100644
--- a/code/modules/security levels/keycard authentication.dm
+++ b/code/modules/security levels/keycard authentication.dm
@@ -80,13 +80,11 @@
/obj/machinery/keycard_auth/Topic(href, href_list)
- ..()
+ if(..())
+ return
if(busy)
usr << "This device is busy."
return
- if(usr.stat || stat & (BROKEN|NOPOWER))
- usr << "This device is without power."
- return
if(href_list["triggerevent"])
event = href_list["triggerevent"]
screen = 2
@@ -94,7 +92,6 @@
reset()
updateUsrDialog()
- add_fingerprint(usr)
return
/obj/machinery/keycard_auth/proc/reset()