diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index efe94a3261..2c8e3164a9 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -45,7 +45,7 @@
radiomod = ";" //AIs will, by default, state their laws on the internal radio.
var/obj/item/pda/ai/aiPDA
var/obj/item/multitool/aiMulti
- var/mob/living/simple_animal/bot/Bot
+ var/datum/weakref/bot_ref
var/tracking = FALSE //this is 1 if the AI is currently tracking somebody, but the track has not yet been completed.
var/datum/effect_system/spark_spread/spark_system //So they can initialize sparks whenever/N
var/obj/machinery/status_display/controlled_display
@@ -100,7 +100,6 @@
var/display_icon_override
var/emote_display = "Neutral" //text string of the current emote we set for the status displays, to prevent logins resetting it.
- // TODO: Currently unused, needs port from TG.
var/datum/robot_control/robot_control
// TODO: Currently unused, needs port from TG.
/// Station alert datum for showing alerts UI
@@ -203,14 +202,13 @@
QDEL_NULL(spark_system)
QDEL_NULL(malf_picker)
QDEL_NULL(doomsday_device)
- // TODO: Port implementation of these from TG or remove the unused code.
- // QDEL_NULL(robot_control)
+ QDEL_NULL(robot_control)
// QDEL_NULL(alert_control)
QDEL_NULL(aiMulti)
QDEL_NULL(aiPDA)
malfhack = null
current = null
- Bot = null
+ bot_ref = null
controlled_equipment = null
linked_core = null
apc_override = null
@@ -480,24 +478,6 @@
else
to_chat(src, "Target is not on or near any active cameras on the station.")
return
- if(href_list["callbot"]) //Command a bot to move to a selected location.
- if(call_bot_cooldown > world.time)
- to_chat(src, "Error: Your last call bot command is still processing, please wait for the bot to finish calculating a route.")
- return
- Bot = locate(href_list["callbot"]) in GLOB.alive_mob_list
- if(!Bot || Bot.remote_disabled || src.control_disabled)
- return //True if there is no bot found, the bot is manually emagged, or the AI is carded with wireless off.
- waypoint_mode = 1
- to_chat(src, "Set your waypoint by clicking on a valid location free of obstructions.")
- return
- if(href_list["interface"]) //Remotely connect to a bot!
- Bot = locate(href_list["interface"]) in GLOB.alive_mob_list
- if(!Bot || Bot.remote_disabled || src.control_disabled)
- return
- Bot.attack_ai(src)
- if(href_list["botrefresh"]) //Refreshes the bot control panel.
- botcall()
- return
if (href_list["ai_take_control"]) //Mech domination
var/obj/vehicle/sealed/mecha/M = locate(href_list["ai_take_control"]) in GLOB.mechas_list
@@ -544,33 +524,11 @@
set category = "AI Commands"
set name = "Access Robot Control"
set desc = "Wirelessly control various automatic robots."
- if(incapacitated())
- return
- if(control_disabled)
- to_chat(src, "Wireless control is disabled.")
- return
- var/turf/ai_current_turf = get_turf(src)
- var/ai_Zlevel = ai_current_turf.z
- var/d
- d += "Query network status "
- d += "
Name
Status
Location
Control
"
+ if(!robot_control)
+ robot_control = new(src)
- for (Bot in GLOB.alive_mob_list)
- if(Bot.z == ai_Zlevel && !Bot.remote_disabled) //Only non-emagged bots on the same Z-level are detected!
- var/bot_mode = Bot.get_mode()
- d += "
"
- //If the bot is on, it will display the bot's current mode status. If the bot is not mode, it will just report "Idle". "Inactive if it is not on at all.
- d += "