diff --git a/code/datums/wires/apc.dm b/code/datums/wires/apc.dm
index b0b29b30001..db5011406ab 100644
--- a/code/datums/wires/apc.dm
+++ b/code/datums/wires/apc.dm
@@ -8,9 +8,11 @@ var/const/APC_WIRE_MAIN_POWER2 = 4
var/const/APC_WIRE_AI_CONTROL = 8
/datum/wires/apc/GetInteractWindow()
- //var/obj/machinery/power/apc/A = holder
+ var/obj/machinery/power/apc/A = holder
. += "
Area Power Control
"
. += ..(0, 1)
+ . += text("
\n[(A.locked ? "The APC is locked." : "The APC is unlocked.")]
\n[(A.shorted ? "The APCs power has been shorted." : "The APC is working properly!")]
\n[(A.aidisabled ? "The 'AI control allowed' light is off." : "The 'AI control allowed' light is on.")]")
+
/datum/wires/apc/CanUse(var/mob/living/L)
var/obj/machinery/power/apc/A = holder
diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm
index 29d92eda795..0fe2d612367 100644
--- a/code/game/machinery/telecomms/telecomunications.dm
+++ b/code/game/machinery/telecomms/telecomunications.dm
@@ -527,6 +527,13 @@ var/global/list/obj/machinery/telecomms/telecomms_list = list()
Compiler.Holder = src
server_radio = new()
+/obj/machinery/telecomms/server/Del()
+ // Garbage collects all the NTSL datums.
+ if(Compiler)
+ Compiler.GC()
+ Compiler = null
+ ..()
+
/obj/machinery/telecomms/server/receive_information(datum/signal/signal, obj/machinery/telecomms/machine_from)
if(signal.data["message"])
diff --git a/code/game/machinery/telecomms/traffic_control.dm b/code/game/machinery/telecomms/traffic_control.dm
index a8811e217b3..08d2fa1e8ce 100644
--- a/code/game/machinery/telecomms/traffic_control.dm
+++ b/code/game/machinery/telecomms/traffic_control.dm
@@ -117,16 +117,20 @@
// --- Viewing Server ---
if(1)
- dat += "
[temp]
"
- dat += "\[Main Menu\] \[Refresh\]"
- dat += "
Current Network: [network]"
- dat += "
Selected Server: [SelectedServer.id]
"
- dat += "
\[Edit Code\]"
- dat += "
Signal Execution: "
- if(SelectedServer.autoruncode)
- dat += "ALWAYS"
+ if(SelectedServer)
+ dat += "
[temp]
"
+ dat += "\[Main Menu\] \[Refresh\]"
+ dat += "
Current Network: [network]"
+ dat += "
Selected Server: [SelectedServer.id]
"
+ dat += "
\[Edit Code\]"
+ dat += "
Signal Execution: "
+ if(SelectedServer.autoruncode)
+ dat += "ALWAYS"
+ else
+ dat += "NEVER"
else
- dat += "NEVER"
+ screen = 0
+ return
user << browse(dat, "window=traffic_control;size=575x400")
diff --git a/code/modules/mob/living/carbon/alien/humanoid/inventory.dm b/code/modules/mob/living/carbon/alien/humanoid/inventory.dm
index 0e03bf68923..5a29e4dc90e 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/inventory.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/inventory.dm
@@ -22,7 +22,7 @@
/mob/living/carbon/alien/humanoid/attack_ui(slot_id)
var/obj/item/W = get_active_hand()
if(W)
- if(!istype(W)) return
+ if(!istype(W)) return 0
switch(slot_id)
// if("o_clothing")
// if("head")
@@ -51,4 +51,5 @@
if(slot_l_store)
if(l_store) l_store.attack_alien(src)
if(slot_r_store)
- if(r_store) r_store.attack_alien(src)
\ No newline at end of file
+ if(r_store) r_store.attack_alien(src)
+ return 1
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index bf39a4ee959..ed71ab9fa86 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -135,6 +135,8 @@
if(selhand != src.hand)
swap_hand()
+ else
+ mode() // Activate held item
/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
if(health >= 0)
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index e7a5b91af27..7f6cbe5b614 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -6,6 +6,48 @@
del(W)
return null
+// Return the item currently in the slot ID
+/mob/living/carbon/human/get_item_by_slot(var/slot_id)
+
+ switch(slot_id)
+ if(slot_back)
+ return back
+ if(slot_wear_mask)
+ return wear_mask
+ if(slot_handcuffed)
+ return handcuffed
+ if(slot_legcuffed)
+ return legcuffed
+ if(slot_l_hand)
+ return l_hand
+ if(slot_r_hand)
+ return r_hand
+ if(slot_belt)
+ return belt
+ if(slot_wear_id)
+ return wear_id
+ if(slot_ears)
+ return ears
+ if(slot_glasses)
+ return glasses
+ if(slot_gloves)
+ return gloves
+ if(slot_head)
+ return head
+ if(slot_shoes)
+ return shoes
+ if(slot_wear_suit)
+ return wear_suit
+ if(slot_w_uniform)
+ return w_uniform
+ if(slot_l_store)
+ return l_store
+ if(slot_r_store)
+ return r_store
+ if(slot_s_store)
+ return s_store
+ return null
+
/mob/living/carbon/human/u_equip(obj/item/W as obj)
if(!W) return 0
diff --git a/code/modules/mob/mob.dm b/code/modules/mob/mob.dm
index 8ff661b2e16..fb52c303c87 100644
--- a/code/modules/mob/mob.dm
+++ b/code/modules/mob/mob.dm
@@ -127,6 +127,8 @@
// organStructure.ProcessOrgans()
return
+/mob/proc/get_item_by_slot(var/slot_id)
+ return
/mob/proc/restrained()
return
@@ -136,7 +138,16 @@
var/obj/item/W = get_active_hand()
if(istype(W))
- equip_to_slot_if_possible(W, slot)
+ if(equip_to_slot_if_possible(W, slot))
+ return 1
+
+ if(!W)
+ // Activate the item
+ var/obj/item/I = get_item_by_slot(slot)
+ if(istype(I))
+ I.attack_hand(src)
+
+ return 0
/mob/proc/put_in_any_hand_if_possible(obj/item/W as obj, del_on_fail = 0, disable_warning = 1, redraw_mob = 1)
if(equip_to_slot_if_possible(W, slot_l_hand, del_on_fail, disable_warning, redraw_mob))
diff --git a/code/modules/mob/screen.dm b/code/modules/mob/screen.dm
index 3159d6908ef..8e521ea68e2 100644
--- a/code/modules/mob/screen.dm
+++ b/code/modules/mob/screen.dm
@@ -63,8 +63,11 @@
name = "storage"
master = null
-/obj/screen/storage/attackby(W, mob/user as mob)
- src.master.attackby(W, user)
+/obj/screen/storage/attack_hand(mob/user as mob)
+ if(src.master)
+ var/obj/item/I = user.get_active_hand()
+ if(I)
+ src.master.attackby(I, user)
return
/obj/screen/zone_sel
@@ -463,15 +466,15 @@
return
/obj/screen/inventory/attack_hand(mob/user as mob)
- user.attack_ui(slot_id)
- user.update_inv_l_hand(0)
- user.update_inv_r_hand()
+ if(user.attack_ui(slot_id))
+ user.update_inv_l_hand(0)
+ user.update_inv_r_hand()
return
/obj/screen/inventory/attack_paw(mob/user as mob)
- user.attack_ui(slot_id)
- user.update_inv_l_hand(0)
- user.update_inv_r_hand()
+ if(user.attack_ui(slot_id))
+ user.update_inv_l_hand(0)
+ user.update_inv_r_hand()
return
diff --git a/code/modules/scripting/Implementations/Telecomms.dm b/code/modules/scripting/Implementations/Telecomms.dm
index abb71a9e199..265e2540a45 100644
--- a/code/modules/scripting/Implementations/Telecomms.dm
+++ b/code/modules/scripting/Implementations/Telecomms.dm
@@ -10,11 +10,26 @@
HandleError(runtimeError/e)
Compiler.Holder.add_entry(e.ToString(), "Execution Error")
+ GC()
+ ..()
+ Compiler = null
+
+
/datum/TCS_Compiler
+
var/n_Interpreter/TCS_Interpreter/interpreter
var/obj/machinery/telecomms/server/Holder // the server that is running the code
var/ready = 1 // 1 if ready to run code
+ /* -- Set ourselves to Garbage Collect -- */
+
+ proc/GC()
+
+ Holder = null
+ if(interpreter)
+ interpreter.GC()
+
+
/* -- Compile a raw block of text -- */
proc/Compile(code as message)
diff --git a/code/modules/scripting/Interpreter/Interpreter.dm b/code/modules/scripting/Interpreter/Interpreter.dm
index 43a53a50ee0..dd33a2c333b 100644
--- a/code/modules/scripting/Interpreter/Interpreter.dm
+++ b/code/modules/scripting/Interpreter/Interpreter.dm
@@ -55,6 +55,14 @@
if(program)Load(program)
proc
+
+/*
+ Set ourselves to Garbage Collect
+*/
+ GC()
+ ..()
+ container = null
+
/*
Proc: RaiseError
Raises a runtime error.