diff --git a/code/__HELPERS/materials.dm b/code/__HELPERS/materials.dm
new file mode 100644
index 0000000000..96b9b5edc8
--- /dev/null
+++ b/code/__HELPERS/materials.dm
@@ -0,0 +1,11 @@
+/// Turns a material amount into the amount of sheets it should output
+/proc/amount2sheet(amount)
+ if(amount >= MINERAL_MATERIAL_AMOUNT)
+ return round(amount / MINERAL_MATERIAL_AMOUNT)
+ return FALSE
+
+/// Turns an amount of sheets into the amount of material amount it should output
+/proc/sheet2amount(sheet_amount)
+ if(sheet_amount > 0)
+ return sheet_amount * MINERAL_MATERIAL_AMOUNT
+ return FALSE
diff --git a/code/datums/components/_component.dm b/code/datums/components/_component.dm
index 6b99cf8318..3796965673 100644
--- a/code/datums/components/_component.dm
+++ b/code/datums/components/_component.dm
@@ -324,25 +324,26 @@
// The type arg is casted so initial works, you shouldn't be passing a real instance into this
/**
- * Return any component assigned to this datum of the exact given type
- * This will throw an error if it's possible to have more than one component of that type on the parent
- *
- * Arguments:
- * * datum/component/c_type The typepath of the component you want to get a reference to
- */
+ * Return any component assigned to this datum of the exact given type
+ *
+ * This will throw an error if it's possible to have more than one component of that type on the parent
+ *
+ * Arguments:
+ * * datum/component/c_type The typepath of the component you want to get a reference to
+ */
/datum/proc/GetExactComponent(datum/component/c_type)
RETURN_TYPE(c_type)
- if(initial(c_type.dupe_mode) == COMPONENT_DUPE_ALLOWED || initial(c_type.dupe_mode) == COMPONENT_DUPE_SELECTIVE)
+ var/initial_type_mode = initial(c_type.dupe_mode)
+ if(initial_type_mode == COMPONENT_DUPE_ALLOWED || initial_type_mode == COMPONENT_DUPE_SELECTIVE)
stack_trace("GetComponent was called to get a component of which multiple copies could be on an object. This can easily break and should be changed. Type: \[[c_type]\]")
- var/list/dc = datum_components
- if(!dc)
+ var/list/all_components = datum_components
+ if(!all_components)
return null
- var/datum/component/C = dc[c_type]
- if(C)
- if(length(C))
- C = C[1]
- if(C.type == c_type)
- return C
+ var/datum/component/potential_component
+ if(length(all_components))
+ potential_component = all_components[c_type]
+ if(potential_component?.type == c_type)
+ return potential_component
return null
/**
diff --git a/code/datums/components/material_container.dm b/code/datums/components/material_container.dm
index aac8075209..ec847d515b 100644
--- a/code/datums/components/material_container.dm
+++ b/code/datums/components/material_container.dm
@@ -326,7 +326,7 @@
return total_amount_save - total_amount
/// For spawning mineral sheets at a specific location. Used by machines to output sheets.
-/datum/component/material_container/proc/retrieve_sheets(sheet_amt, var/datum/material/M, target = null)
+/datum/component/material_container/proc/retrieve_sheets(sheet_amt, datum/material/M, target = null)
if(!M.sheet_type)
return FALSE //Add greyscale sheet handling here later
if(sheet_amt <= 0)
@@ -410,19 +410,6 @@
return TRUE
return FALSE
-/// Turns a material amount into the amount of sheets it should output
-/datum/component/material_container/proc/amount2sheet(amt)
- if(amt >= MINERAL_MATERIAL_AMOUNT)
- return round(amt / MINERAL_MATERIAL_AMOUNT)
- return FALSE
-
-/// Turns an amount of sheets into the amount of material amount it should output
-/datum/component/material_container/proc/sheet2amount(sheet_amt)
- if(sheet_amt > 0)
- return sheet_amt * MINERAL_MATERIAL_AMOUNT
- return FALSE
-
-
///returns the amount of material relevant to this container; if this container does not support glass, any glass in 'I' will not be taken into account
/datum/component/material_container/proc/get_item_material_amount(obj/item/I)
if(!istype(I) || !I.custom_materials)
diff --git a/code/datums/elements/_element.dm b/code/datums/elements/_element.dm
index a77a519909..7fbd9d00de 100644
--- a/code/datums/elements/_element.dm
+++ b/code/datums/elements/_element.dm
@@ -28,9 +28,9 @@
/// Deactivates the functionality defines by the element on the given datum
/datum/element/proc/Detach(datum/source, force)
SIGNAL_HANDLER
+ SHOULD_CALL_PARENT(TRUE)
SEND_SIGNAL(source, COMSIG_ELEMENT_DETACH, src)
- SHOULD_CALL_PARENT(TRUE)
UnregisterSignal(source, COMSIG_PARENT_QDELETING)
/datum/element/Destroy(force)
diff --git a/code/game/objects/items/pet_carrier.dm b/code/game/objects/items/pet_carrier.dm
index 138472a4c8..9dc18fb996 100644
--- a/code/game/objects/items/pet_carrier.dm
+++ b/code/game/objects/items/pet_carrier.dm
@@ -308,7 +308,7 @@
if(isanimal(occupant))
var/mob/living/simple_animal/animal = occupant
- occupant_gas_supply[GAS_O2] = 0.0064 //make sure it has some gas in so it isn't depressurized
+ occupant_gas_supply.set_moles(GAS_O2, 0.0064) //make sure it has some gas in so it isn't depressurized
occupant_gas_supply.set_temperature(animal.minbodytemp) //simple animals only care about temperature/pressure when their turf isnt a location
if(ishuman(occupant)) //humans require resistance to cold/heat and living in no air while inside, and lose this when outside
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 90573b44a0..acccf1674c 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -2649,7 +2649,7 @@
if(response.body == "[]")
dat += "
0 bans detected for [ckey]"
else
- bans = json_decode(response["body"])
+ bans = json_decode(response.body)
//Ignore bans from non-whitelisted sources, if a whitelist exists
var/list/valid_sources
diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm
index db9eda055d..11508f975b 100644
--- a/code/modules/clothing/head/jobs.dm
+++ b/code/modules/clothing/head/jobs.dm
@@ -229,7 +229,7 @@
. = ..()
UnregisterSignal(M, COMSIG_MOB_SAY)
-/obj/item/clothing/head/warden/drill/proc/handle_speech(datum/source, mob/speech_args)
+/obj/item/clothing/head/warden/drill/proc/handle_speech(datum/source, list/speech_args)
var/message = speech_args[SPEECH_MESSAGE]
if(message[1] != "*")
switch (mode)
diff --git a/code/modules/clothing/head/misc.dm b/code/modules/clothing/head/misc.dm
index d24e004802..d31562ad5f 100644
--- a/code/modules/clothing/head/misc.dm
+++ b/code/modules/clothing/head/misc.dm
@@ -364,7 +364,7 @@
. = ..()
UnregisterSignal(M, COMSIG_MOB_SAY)
-/obj/item/clothing/head/frenchberet/proc/handle_speech(datum/source, mob/speech_args)
+/obj/item/clothing/head/frenchberet/proc/handle_speech(datum/source, list/speech_args)
var/message = speech_args[SPEECH_MESSAGE]
if(message[1] != "*")
message = " [message]"
diff --git a/code/modules/integrated_electronics/core/helpers.dm b/code/modules/integrated_electronics/core/helpers.dm
index 91ede4f09e..1e543e28c7 100644
--- a/code/modules/integrated_electronics/core/helpers.dm
+++ b/code/modules/integrated_electronics/core/helpers.dm
@@ -22,16 +22,21 @@
/obj/item/integrated_circuit/proc/set_pin_data(pin_type, pin_number, datum/new_data)
if(islist(new_data))
- for(var/i in 1 to length(new_data))
- if (istype(new_data) && !isweakref(new_data))
- new_data[i] = WEAKREF(new_data[i])
- if (istype(new_data) && !isweakref(new_data))
+ var/list/new_data_list = new_data
+ var/list/output = list()
+ for(var/data_iterator in 1 to length(new_data_list))
+ if (isdatum(new_data_list[data_iterator]) && !isweakref(new_data_list[data_iterator]))
+ output[data_iterator] = WEAKREF(new_data_list[data_iterator])
+ new_data = output
+ else if (isdatum(new_data) && !isweakref(new_data))
new_data = WEAKREF(new_data)
var/datum/integrated_io/pin = get_pin_ref(pin_type, pin_number)
return pin.write_data_to_pin(new_data)
/obj/item/integrated_circuit/proc/get_pin_data(pin_type, pin_number)
var/datum/integrated_io/pin = get_pin_ref(pin_type, pin_number)
+ if(QDELETED(pin))
+ return
var/data = pin.get_data()
if(istext(data))
data = sanitize_text(data)
@@ -39,6 +44,8 @@
/obj/item/integrated_circuit/proc/get_pin_data_as_type(pin_type, pin_number, as_type)
var/datum/integrated_io/pin = get_pin_ref(pin_type, pin_number)
+ if(QDELETED(pin))
+ return
return pin.data_as_type(as_type)
/obj/item/integrated_circuit/proc/activate_pin(pin_number)
@@ -63,10 +70,14 @@
/datum/integrated_io/proc/get_data()
if(islist(data))
- for(var/i in 1 to length(data))
- if(isweakref(data[i]))
- data[i] = data[i].resolve()
- if(isweakref(data))
+ var/list/data_list = data
+ var/list/output = list()
+ for(var/data_iterator in 1 to length(data_list))
+ if(isweakref(data_list[data_iterator]))
+ var/datum/weakref/data_weakref = data_list[data_iterator]
+ output[data_iterator] = data_weakref.resolve()
+ data = output
+ else if(isweakref(data))
return data.resolve()
return data
diff --git a/code/modules/integrated_electronics/core/integrated_circuit.dm b/code/modules/integrated_electronics/core/integrated_circuit.dm
index f2596dad84..3198042460 100644
--- a/code/modules/integrated_electronics/core/integrated_circuit.dm
+++ b/code/modules/integrated_electronics/core/integrated_circuit.dm
@@ -268,10 +268,10 @@ a creative player the means to solve many problems. Circuits are held inside an
if(href_list["link"])
linked = locate(href_list["link"]) in pin.linked
- if(istype(held_item, /obj/item/integrated_electronics) || held_item.tool_behaviour == TOOL_MULTITOOL)
+ if(!QDELETED(held_item) && (istype(held_item, /obj/item/integrated_electronics) || held_item.tool_behaviour == TOOL_MULTITOOL))
update_to_assembly = pin.handle_wire(linked, held_item, href_list["act"], usr)
else
- to_chat(usr, "You can't do a whole lot without the proper tools.")
+ to_chat(usr, span_warning("You can't do a whole lot without the proper tools."))
success = FALSE
if(success && assembly)
assembly.add_allowed_scanner(usr.ckey)
diff --git a/code/modules/integrated_electronics/subtypes/input.dm b/code/modules/integrated_electronics/subtypes/input.dm
index 69c6263eb7..92593c4fb1 100644
--- a/code/modules/integrated_electronics/subtypes/input.dm
+++ b/code/modules/integrated_electronics/subtypes/input.dm
@@ -1073,6 +1073,9 @@
push_data()
activate_pin(3)
+#define PIN_ACTIVATOR_OUTPUT_ON_SCANNED 2
+#define PIN_ACTIVATOR_OUTPUT_NOT_SCANNED 3
+
/obj/item/integrated_circuit/input/matscan
name = "material scanner"
desc = "This special module is designed to get information about material containers of different machinery, \
@@ -1091,9 +1094,8 @@
"Solid Plasma" = IC_PINTYPE_NUMBER,
"Uranium" = IC_PINTYPE_NUMBER,
"Bananium" = IC_PINTYPE_NUMBER,
- "Titanium" = IC_PINTYPE_NUMBER,
+ "Titanium" = IC_PINTYPE_NUMBER,
"Bluespace Mesh" = IC_PINTYPE_NUMBER,
- "Biomass" = IC_PINTYPE_NUMBER,
"Plastic" = IC_PINTYPE_NUMBER
)
activators = list(
@@ -1103,25 +1105,43 @@
)
spawn_flags = IC_SPAWN_RESEARCH
power_draw_per_use = 40
- var/list/mtypes = list(/datum/material/iron, /datum/material/glass, /datum/material/silver, /datum/material/gold, /datum/material/diamond, /datum/material/plasma, /datum/material/uranium, /datum/material/bananium, /datum/material/titanium, /datum/material/bluespace, /datum/material/biomass, /datum/material/plastic)
+ var/list/mtypes = list(
+ /datum/material/iron,
+ /datum/material/glass,
+ /datum/material/silver,
+ /datum/material/gold,
+ /datum/material/diamond,
+ /datum/material/plasma,
+ /datum/material/uranium,
+ /datum/material/bananium,
+ /datum/material/titanium,
+ /datum/material/bluespace,
+ /datum/material/plastic,
+ )
/obj/item/integrated_circuit/input/matscan/do_work()
- var/atom/movable/H = get_pin_data_as_type(IC_INPUT, 1, /atom/movable)
- var/turf/T = get_turf(src)
- var/datum/component/material_container/mt = H.GetComponent(/datum/component/material_container)
- if(!mt) //Invalid input
+ var/atom/movable/scanned_thing = get_pin_data_as_type(IC_INPUT, 1, /atom/movable)
+ if(!scanned_thing)
+ activate_pin(PIN_ACTIVATOR_OUTPUT_NOT_SCANNED)
return
- if(H in view(T)) // This is a camera. It can't examine thngs,that it can't see.
- for(var/I in mtypes)
- if(I in mt.materials)
- set_pin_data(IC_OUTPUT, I, mt.materials[I])
- else
- set_pin_data(IC_OUTPUT, I, null)
+ var/datum/component/material_container/scanned_storage = scanned_thing.GetComponent(/datum/component/material_container)
+ if(!scanned_storage) //Invalid input
+ var/datum/component/remote_materials/remote_storage = scanned_thing.GetComponent(/datum/component/remote_materials)
+ if(QDELETED(remote_storage))
+ activate_pin(PIN_ACTIVATOR_OUTPUT_NOT_SCANNED)
+ return
+ scanned_storage = remote_storage.mat_container
+ if(scanned_thing in view(drop_location())) // This is a camera. It can't examine thngs,that it can't see.
+ for(var/material_iterator in 1 to length(mtypes))
+ set_pin_data(IC_OUTPUT, material_iterator, scanned_storage.materials[SSmaterials.GetMaterialRef(mtypes[material_iterator])] || 0)
push_data()
- activate_pin(2)
+ activate_pin(PIN_ACTIVATOR_OUTPUT_ON_SCANNED)
else
- activate_pin(3)
+ activate_pin(PIN_ACTIVATOR_OUTPUT_NOT_SCANNED)
+
+#undef PIN_ACTIVATOR_OUTPUT_ON_SCANNED
+#undef PIN_ACTIVATOR_OUTPUT_NOT_SCANNED
/obj/item/integrated_circuit/input/atmospheric_analyzer
name = "atmospheric analyzer"
diff --git a/code/modules/integrated_electronics/subtypes/manipulation.dm b/code/modules/integrated_electronics/subtypes/manipulation.dm
index a6b8ed7f72..26729b7e7a 100644
--- a/code/modules/integrated_electronics/subtypes/manipulation.dm
+++ b/code/modules/integrated_electronics/subtypes/manipulation.dm
@@ -359,14 +359,25 @@
A.throwforce = initial(A.throwforce)
A.embedding = initial(A.embedding)
+#define PIN_ACTIVATOR_INPUT_INSERT_SHEET 1
+#define PIN_ACTIVATOR_INPUT_TRANSFER_MATS 2
+#define PIN_ACTIVATOR_OUTPUT_ON_SUCCESS 3
+#define PIN_ACTIVATOR_OUTPUT_ON_FAILURE 4
+#define PIN_ACTIVATOR_INPUT_PUSH_REF 5
+#define PIN_ACTIVATOR_OUTPUT_ON_PUSH_REF 6
+
/obj/item/integrated_circuit/manipulation/matman
name = "material manager"
desc = "This circuit is designed for automatic storage and distribution of materials."
- extended_desc = "The first input takes a ref of a machine with a material container. \
- Second input is used for inserting material stacks into the internal material storage. \
- Inputs 3-13 are used to transfer materials between target machine and circuit storage. \
- Positive values will take that number of materials from another machine. \
- Negative values will fill another machine from internal storage. Outputs show current stored amounts of mats."
+ extended_desc = \
+ "The first input takes a ref of a machine with a material container.
\
+ Second input is used for inserting material stacks into the internal material storage.
\
+ Inputs 3-13 are used to transfer materials between target machine and circuit storage.
\
+ Positive values will take that number of materials from another machine.
\
+ Negative values will fill another machine from internal storage.
\
+ Unless target is null, which will have the machine drop the material on the floor.
\
+ Outputs show current stored amounts of mats.
\
+ Corporate note, %MINERAL_MATERIAL_AMOUNT%cm³ makes a sheet, any less than that cannot be retrieved."
icon_state = "grabber"
complexity = 16
inputs = list(
@@ -377,11 +388,11 @@
"Silver" = IC_PINTYPE_NUMBER,
"Gold" = IC_PINTYPE_NUMBER,
"Diamond" = IC_PINTYPE_NUMBER,
- "Uranium" = IC_PINTYPE_NUMBER,
"Solid Plasma" = IC_PINTYPE_NUMBER,
- "Bluespace Mesh" = IC_PINTYPE_NUMBER,
+ "Uranium" = IC_PINTYPE_NUMBER,
"Bananium" = IC_PINTYPE_NUMBER,
"Titanium" = IC_PINTYPE_NUMBER,
+ "Bluespace Mesh" = IC_PINTYPE_NUMBER,
"Plastic" = IC_PINTYPE_NUMBER
)
outputs = list(
@@ -392,20 +403,20 @@
"Silver" = IC_PINTYPE_NUMBER,
"Gold" = IC_PINTYPE_NUMBER,
"Diamond" = IC_PINTYPE_NUMBER,
- "Uranium" = IC_PINTYPE_NUMBER,
"Solid Plasma" = IC_PINTYPE_NUMBER,
- "Bluespace Mesh" = IC_PINTYPE_NUMBER,
+ "Uranium" = IC_PINTYPE_NUMBER,
"Bananium" = IC_PINTYPE_NUMBER,
"Titanium" = IC_PINTYPE_NUMBER,
+ "Bluespace Mesh" = IC_PINTYPE_NUMBER,
"Plastic" = IC_PINTYPE_NUMBER
- )
+ )
activators = list(
"insert sheet" = IC_PINTYPE_PULSE_IN,
"transfer mats" = IC_PINTYPE_PULSE_IN,
"on success" = IC_PINTYPE_PULSE_OUT,
"on failure" = IC_PINTYPE_PULSE_OUT,
"push ref" = IC_PINTYPE_PULSE_IN,
- "on push ref" = IC_PINTYPE_PULSE_IN
+ "on push ref" = IC_PINTYPE_PULSE_OUT
)
spawn_flags = IC_SPAWN_RESEARCH
power_draw_per_use = 40
@@ -417,81 +428,101 @@
/datum/material/silver,
/datum/material/gold,
/datum/material/diamond,
- /datum/material/uranium,
/datum/material/plasma,
- /datum/material/bluespace,
+ /datum/material/uranium,
/datum/material/bananium,
/datum/material/titanium,
- /datum/material/plastic
- )
+ /datum/material/bluespace,
+ /datum/material/plastic,
+ )
+
+/obj/item/integrated_circuit/manipulation/matman/Initialize(mapload)
+ . = ..()
+ extended_desc = replacetext(extended_desc, "%MINERAL_MATERIAL_AMOUNT%", MINERAL_MATERIAL_AMOUNT)
/obj/item/integrated_circuit/manipulation/matman/ComponentInitialize()
- var/datum/component/material_container/materials = AddComponent(/datum/component/material_container, mtypes, 100000, FALSE, /obj/item/stack, CALLBACK(src, PROC_REF(is_insertion_ready)), CALLBACK(src, PROC_REF(AfterMaterialInsert)))
+ var/datum/component/material_container/materials = AddComponent(/datum/component/material_container, mtypes.Copy(), 100000, FALSE, /obj/item/stack, CALLBACK(src, PROC_REF(is_insertion_ready)), CALLBACK(src, PROC_REF(AfterMaterialInsert)))
materials.precise_insertion = TRUE
- .=..()
+ return ..()
/obj/item/integrated_circuit/manipulation/matman/proc/AfterMaterialInsert(type_inserted, id_inserted, amount_inserted)
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
set_pin_data(IC_OUTPUT, 2, materials.total_amount)
- for(var/I in 1 to mtypes.len)
- var/datum/material/M = materials.materials[SSmaterials.GetMaterialRef(I)]
- var/amount = materials[M]
- if(M)
- set_pin_data(IC_OUTPUT, I+2, amount)
+ for(var/material_iterator in 1 to length(mtypes))
+ var/amount = materials.materials[SSmaterials.GetMaterialRef(mtypes[material_iterator])]
+ set_pin_data(IC_OUTPUT, material_iterator+2, amount || 0)
push_data()
/obj/item/integrated_circuit/manipulation/matman/proc/is_insertion_ready(mob/user)
return TRUE
-/obj/item/integrated_circuit/manipulation/matman/do_work(ord)
- var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
- var/atom/movable/H = get_pin_data_as_type(IC_INPUT, 1, /atom/movable)
- if(!check_target(H))
- activate_pin(4)
- return
- var/turf/T = get_turf(H)
- switch(ord)
- if(1)
- var/obj/item/stack/sheet/S = H
- if(!S)
- activate_pin(4)
+/obj/item/integrated_circuit/manipulation/matman/do_work(activated_input_pin)
+ var/datum/component/material_container/local_storage = GetComponent(/datum/component/material_container)
+ var/atom/movable/scanned_thing = get_pin_data_as_type(IC_INPUT, 1, /atom/movable)
+ switch(activated_input_pin)
+ if(PIN_ACTIVATOR_INPUT_INSERT_SHEET)
+ var/obj/item/stack/sheet/sheet = scanned_thing
+ if(QDELETED(sheet) || !istype(sheet))
+ activate_pin(PIN_ACTIVATOR_OUTPUT_ON_FAILURE)
return
- if(materials.insert_item(S, clamp(get_pin_data(IC_INPUT, 2),0,100), multiplier = 1) )
+ if(!check_target(scanned_thing, exclude_components = TRUE, exclude_self = TRUE))
+ activate_pin(PIN_ACTIVATOR_OUTPUT_ON_FAILURE)
+ return
+ if(local_storage.insert_stack(sheet, clamp(get_pin_data(IC_INPUT, 2),0,100), 1))
AfterMaterialInsert()
- activate_pin(3)
+ activate_pin(PIN_ACTIVATOR_OUTPUT_ON_SUCCESS)
else
- activate_pin(4)
- if(2)
- var/datum/component/material_container/mt = H.GetComponent(/datum/component/material_container)
- var/suc
- for(var/I in 1 to mtypes.len)
- var/datum/material/M = materials.materials[mtypes[I]]
- if(M)
- var/U = clamp(get_pin_data(IC_INPUT, I+2),-100000,100000)
- if(!U)
+ activate_pin(PIN_ACTIVATOR_OUTPUT_ON_FAILURE)
+ if(PIN_ACTIVATOR_INPUT_TRANSFER_MATS)
+ var/datum/component/material_container/scanned_storage = scanned_thing?.GetComponent(/datum/component/material_container)
+ if(QDELETED(scanned_storage))
+ var/datum/component/remote_materials/remote_storage = scanned_thing?.GetComponent(/datum/component/remote_materials)
+ if(!QDELETED(remote_storage))
+ scanned_storage = remote_storage.mat_container
+ var/successful_transfer
+ for(var/material_iterator in 1 to length(mtypes))
+ var/datum/material/material_to_transfer = SSmaterials.GetMaterialRef(mtypes[material_iterator])
+ if(material_to_transfer)
+ var/amount = clamp(get_pin_data(IC_INPUT, material_iterator + 2), -100000, 100000)
+ if(!amount)
continue
- if(!mt) //Invalid input
- if(U>0)
- if(materials.retrieve_sheets(U, SSmaterials.GetMaterialRef(mtypes[I]), T))
- suc = TRUE
+ if(isnull(scanned_thing))
+ if(amount > 0)
+ if(local_storage.retrieve_sheets(amount2sheet(amount), material_to_transfer, drop_location()))
+ successful_transfer = TRUE
+ else if(!QDELETED(scanned_storage))
+ if(QDELETED(scanned_thing))
+ activate_pin(PIN_ACTIVATOR_OUTPUT_ON_FAILURE)
+ return
+ // exclude_contents = FALSE, if someone EVER makes literal tom's storage in SS13, i'm evilly giving you this.
+ if(!check_target(scanned_thing, exclude_components = TRUE, exclude_self = TRUE))
+ activate_pin(PIN_ACTIVATOR_OUTPUT_ON_FAILURE)
+ return
+ if(scanned_storage.transer_amt_to(local_storage, amount, material_to_transfer))
+ successful_transfer = TRUE
else
- if(mt.transer_amt_to(materials, U, mtypes[I]))
- suc = TRUE
- if(suc)
+ activate_pin(PIN_ACTIVATOR_OUTPUT_ON_FAILURE)
+ if(successful_transfer)
AfterMaterialInsert()
- activate_pin(3)
+ activate_pin(PIN_ACTIVATOR_OUTPUT_ON_SUCCESS)
else
- activate_pin(4)
- if(5)
+ activate_pin(PIN_ACTIVATOR_OUTPUT_ON_FAILURE)
+ if(PIN_ACTIVATOR_INPUT_PUSH_REF)
set_pin_data(IC_OUTPUT, 1, WEAKREF(src))
AfterMaterialInsert()
- activate_pin(6)
+ activate_pin(PIN_ACTIVATOR_OUTPUT_ON_PUSH_REF)
/obj/item/integrated_circuit/manipulation/matman/Destroy()
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
materials.retrieve_all()
- .=..()
+ return ..()
+#undef PIN_ACTIVATOR_INPUT_INSERT_SHEET
+#undef PIN_ACTIVATOR_INPUT_TRANSFER_MATS
+#undef PIN_ACTIVATOR_OUTPUT_ON_SUCCESS
+#undef PIN_ACTIVATOR_OUTPUT_ON_FAILURE
+#undef PIN_ACTIVATOR_INPUT_PUSH_REF
+#undef PIN_ACTIVATOR_OUTPUT_ON_PUSH_REF
//Hippie Ported Code--------------------------------------------------------------------------------------------------------
diff --git a/modular_citadel/code/modules/reagents/objects/clothes.dm b/modular_citadel/code/modules/reagents/objects/clothes.dm
index 2fb61749f8..a029ada752 100644
--- a/modular_citadel/code/modules/reagents/objects/clothes.dm
+++ b/modular_citadel/code/modules/reagents/objects/clothes.dm
@@ -52,7 +52,7 @@
var/mob/living/simple_animal/hostile/mimic/M = loc
M.say(pick("Whooee! Time for a hootenanny!", "Rough 'em up boys!", "Yeehaw! Freedom at last!", "Y'all about to get a good old fashioned spanking!"))
-/obj/item/clothing/head/hattip/proc/handle_speech(datum/source, mob/speech_args)
+/obj/item/clothing/head/hattip/proc/handle_speech(datum/source, list/speech_args)
var/message = speech_args[SPEECH_MESSAGE]
var/mob/living/carbon/C = get_wearer()//user
var/obj/item/organ/tongue/T = C.getorganslot(ORGAN_SLOT_TONGUE)
diff --git a/tgstation.dme b/tgstation.dme
index 9fac7f9b7d..882791e20c 100644
--- a/tgstation.dme
+++ b/tgstation.dme
@@ -219,6 +219,7 @@
#include "code\__HELPERS\level_traits.dm"
#include "code\__HELPERS\lighting.dm"
#include "code\__HELPERS\markov.dm"
+#include "code\__HELPERS\materials.dm"
#include "code\__HELPERS\matrices.dm"
#include "code\__HELPERS\mobs.dm"
#include "code\__HELPERS\mouse_control.dm"