mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2026-07-18 19:53:35 +01:00
Little Weakref Refactor
This commit is contained in:
committed by
CHOMPStation2
parent
515d0e49ba
commit
3d53d2bb62
@@ -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>")
|
||||
@@ -564,4 +564,7 @@
|
||||
for(var/i = 1 to 4)
|
||||
new IC.type(src)
|
||||
make_exact_fit()
|
||||
<<<<<<< HEAD
|
||||
. = ..()
|
||||
=======
|
||||
>>>>>>> b22b9e6e48... Merge pull request #14936 from ItsSelis/selis-weakrefs
|
||||
|
||||
Reference in New Issue
Block a user