Merge branch 'master' into upstream-merge-14976

This commit is contained in:
Raeschen
2023-06-17 14:47:37 +02:00
committed by GitHub
147 changed files with 1521 additions and 593 deletions

View File

@@ -263,7 +263,7 @@
if(proximity)
var/scanned = FALSE
for(var/obj/item/integrated_circuit/input/sensor/S in contents)
// S.set_pin_data(IC_OUTPUT, 1, weakref(target))
// S.set_pin_data(IC_OUTPUT, 1, WEAKREF(target))
// S.check_then_do_work()
if(S.scan(target))
scanned = TRUE
@@ -397,4 +397,4 @@
// Returns TRUE if I is something that could/should have a valid interaction. Used to tell circuitclothes to hit the circuit with something instead of the clothes
/obj/item/device/electronic_assembly/proc/is_valid_tool(var/obj/item/I)
return I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/integrated_circuit) || istype(I, /obj/item/weapon/cell/device) || istype(I, /obj/item/device/integrated_electronics)
return I.is_crowbar() || I.is_screwdriver() || istype(I, /obj/item/integrated_circuit) || istype(I, /obj/item/weapon/cell/device) || istype(I, /obj/item/device/integrated_electronics)

View File

@@ -21,7 +21,7 @@
/obj/item/integrated_circuit/proc/set_pin_data(var/pin_type, var/pin_number, datum/new_data)
if (istype(new_data) && !isweakref(new_data))
new_data = weakref(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)
@@ -72,4 +72,4 @@
if(pin)
debugger.write_data(pin, usr)
return 1
return 0
return 0

View File

@@ -21,7 +21,7 @@ D [1]/ ||
/datum/integrated_io
var/name = "input/output"
var/obj/item/integrated_circuit/holder = null
var/weakref/data = null // This is a weakref, to reduce typecasts. Note that oftentimes numbers and text may also occupy this.
var/datum/weakref/data = null // This is a weakref, to reduce typecasts. Note that oftentimes numbers and text may also occupy this.
var/list/linked = list()
var/io_type = DATA_CHANNEL
@@ -47,7 +47,7 @@ D [1]/ ||
/datum/integrated_io/proc/data_as_type(var/as_type)
if(!isweakref(data))
return
var/weakref/w = data
var/datum/weakref/w = data
var/output = w.resolve()
return istype(output, as_type) ? output : null
@@ -82,7 +82,7 @@ list[](
return result
if(isweakref(input))
var/weakref/w = input
var/datum/weakref/w = input
var/atom/A = w.resolve()
//return A ? "([A.name] \[Ref\])" : "(null)" // For refs, we want just the name displayed.
return A ? "(\ref[A] \[Ref\])" : "(null)"

View File

@@ -143,7 +143,7 @@
/obj/item/device/integrated_electronics/debugger/afterattack(atom/target, mob/living/user, proximity)
if(accepting_refs && proximity)
data_to_write = weakref(target)
data_to_write = WEAKREF(target)
visible_message("<span class='notice'>[user] slides \a [src]'s over \the [target].</span>")
to_chat(user, "<span class='notice'>You set \the [src]'s memory to a reference to [target.name] \[Ref\]. The ref scanner is \
now off.</span>")
@@ -154,7 +154,7 @@
io.write_data_to_pin(data_to_write)
var/data_to_show = data_to_write
if(isweakref(data_to_write))
var/weakref/w = data_to_write
var/datum/weakref/w = data_to_write
var/atom/A = w.resolve()
data_to_show = A.name
to_chat(user, "<span class='notice'>You write '[data_to_write ? data_to_show : "NULL"]' to the '[io]' pin of \the [io.holder].</span>")
@@ -244,7 +244,7 @@
/obj/item/device/multitool/afterattack(atom/target, mob/living/user, proximity)
if(accepting_refs && toolmode == MULTITOOL_MODE_INTCIRCUITS && proximity)
weakref_wiring = weakref(target)
weakref_wiring = WEAKREF(target)
visible_message("<span class='notice'>[user] slides \a [src]'s over \the [target].</span>")
to_chat(user, "<span class='notice'>You set \the [src]'s memory to a reference to [target.name] \[Ref\]. The ref scanner is \
now off.</span>")

View File

@@ -149,7 +149,7 @@
create_reagents(volume)
/obj/item/integrated_circuit/passive/power/chemical_cell/interact(mob/user)
set_pin_data(IC_OUTPUT, 2, weakref(src))
set_pin_data(IC_OUTPUT, 2, WEAKREF(src))
push_data()
..()

View File

@@ -97,7 +97,7 @@
/obj/item/integrated_circuit/converter/refdecode/do_work()
pull_data()
set_pin_data(IC_OUTPUT, 1, weakref(locate(get_pin_data(IC_INPUT, 1))))
set_pin_data(IC_OUTPUT, 1, WEAKREF(locate(get_pin_data(IC_INPUT, 1))))
push_data()
activate_pin(2)
@@ -391,4 +391,4 @@
set_pin_data(IC_OUTPUT, 1, result)
push_data()
activate_pin(2)
activate_pin(2)

View File

@@ -235,7 +235,7 @@
O.data = null
if(assembly)
if(istype(assembly.loc, /mob/living)) // Now check if someone's holding us.
O.data = weakref(assembly.loc)
O.data = WEAKREF(assembly.loc)
O.push_data()
@@ -272,7 +272,7 @@
continue
valid_things.Add(thing)
if(valid_things.len)
O.data = weakref(pick(valid_things))
O.data = WEAKREF(pick(valid_things))
activate_pin(2)
else
activate_pin(3)
@@ -321,7 +321,7 @@
if(findtext(addtext(thing.name," ",thing.desc), DT, 1, 0) )
valid_things.Add(thing)
if(valid_things.len)
O.data = weakref(pick(valid_things))
O.data = WEAKREF(pick(valid_things))
O.push_data()
activate_pin(2)
else
@@ -552,7 +552,7 @@
// as a translation, when it is not.
if(S.speaking && !istype(S.speaking, /datum/language/common))
translated = TRUE
set_pin_data(IC_OUTPUT , 1, weakref(M))//CHOMPADDITION: so we can target the speaker with an action
set_pin_data(IC_OUTPUT , 1, WEAKREF(M))//CHOMPADDITION: so we can target the speaker with an action
set_pin_data(IC_OUTPUT, 2, M.GetVoice())
set_pin_data(IC_OUTPUT, 3, msg)
@@ -605,7 +605,7 @@
for(var/datum/multilingual_say_piece/S in message_pieces)
if(!((S.speaking.flags & NONVERBAL) || (S.speaking.flags & SIGNLANG))||S.speaking.name == LANGUAGE_ECHOSONG) //Ignore verbal languages
return
set_pin_data(IC_OUTPUT , 1, weakref(M))//CHOMPADDITION: so we can target the speaker with an action
set_pin_data(IC_OUTPUT , 1, WEAKREF(M))//CHOMPADDITION: so we can target the speaker with an action
set_pin_data(IC_OUTPUT, 2, M.GetVoice())
set_pin_data(IC_OUTPUT, 3, msg)
@@ -648,7 +648,7 @@
if(istype(A, /obj/item/weapon/storage))
return FALSE
set_pin_data(IC_OUTPUT, 1, weakref(A))
set_pin_data(IC_OUTPUT, 1, WEAKREF(A))
push_data()
activate_pin(1)
return TRUE
@@ -676,7 +676,7 @@
set_pin_data(IC_OUTPUT, 1, null)
set_pin_data(IC_OUTPUT, 2, null)
set_pin_data(IC_OUTPUT, 3, null)
set_pin_data(IC_OUTPUT, 4, weakref(assembly))
set_pin_data(IC_OUTPUT, 4, WEAKREF(assembly))
if(assembly)
if(assembly.battery)

View File

@@ -118,8 +118,8 @@
/obj/item/integrated_circuit/memory/constant/afterattack(atom/target, mob/living/user, proximity)
if(accepting_refs && proximity)
var/datum/integrated_io/O = outputs[1]
O.data = weakref(target)
O.data = WEAKREF(target)
visible_message("<span class='notice'>[user] slides \a [src]'s over \the [target].</span>")
to_chat(user, "<span class='notice'>You set \the [src]'s memory to a reference to [O.display_data(O.data)]. The ref scanner is \
now off.</span>")
accepting_refs = 0
accepting_refs = 0

View File

@@ -32,7 +32,7 @@
/obj/item/integrated_circuit/reagent/smoke/interact(mob/user)
set_pin_data(IC_OUTPUT, 2, weakref(src))
set_pin_data(IC_OUTPUT, 2, WEAKREF(src))
push_data()
..()
@@ -66,7 +66,7 @@
var/transfer_amount = 10
/obj/item/integrated_circuit/reagent/injector/interact(mob/user)
set_pin_data(IC_OUTPUT, 2, weakref(src))
set_pin_data(IC_OUTPUT, 2, WEAKREF(src))
push_data()
..()
@@ -251,7 +251,7 @@
/obj/item/integrated_circuit/reagent/storage/interact(mob/user)
set_pin_data(IC_OUTPUT, 2, weakref(src))
set_pin_data(IC_OUTPUT, 2, WEAKREF(src))
push_data()
..()
@@ -356,6 +356,3 @@
source.reagents.trans_id_to(target, G.id, transfer_amount)
activate_pin(2)
push_data()