mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2026-07-20 12:42:43 +01:00
Fixes some problems from port, mainly ref stuff.
This commit is contained in:
@@ -242,11 +242,12 @@
|
||||
var/list/linked = list()
|
||||
var/io_type = DATA_CHANNEL
|
||||
|
||||
/datum/integrated_io/New(var/newloc)
|
||||
/datum/integrated_io/New(var/newloc, var/name)
|
||||
..()
|
||||
src.name = name
|
||||
holder = newloc
|
||||
if(!holder)
|
||||
message_admins("ERROR: An integrated_io ([src.name]) spawned without a holder! This is a bug.")
|
||||
if(!istype(holder))
|
||||
message_admins("ERROR: An integrated_io ([src.name]) spawned without a valid holder! This is a bug.")
|
||||
|
||||
/datum/integrated_io/Destroy()
|
||||
disconnect()
|
||||
@@ -270,9 +271,10 @@
|
||||
return "(null)" // Empty data means nothing to show.
|
||||
if(istext(data))
|
||||
return "(\"[data]\")" // Wraps the 'string' in escaped quotes, so that people know it's a 'string'.
|
||||
if(istype(data, /atom))
|
||||
var/atom/A = data
|
||||
return "([A.name] \[Ref\])" // For refs, we want just the name displayed.
|
||||
if(isweakref(data))
|
||||
var/weakref/w = data
|
||||
var/atom/A = w.resolve()
|
||||
return A ? "([A.name] \[Ref\])" : "(null)" // For refs, we want just the name displayed.
|
||||
return "([data])" // Nothing special needed for numbers or other stuff.
|
||||
|
||||
/datum/integrated_io/activate/display_data()
|
||||
|
||||
@@ -137,7 +137,7 @@
|
||||
|
||||
/obj/item/device/integrated_electronics/debugger/afterattack(atom/target, mob/living/user, proximity)
|
||||
if(accepting_refs && proximity)
|
||||
data_to_write = 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>")
|
||||
@@ -146,7 +146,12 @@
|
||||
/obj/item/device/integrated_electronics/debugger/proc/write_data(var/datum/integrated_io/io, mob/user)
|
||||
if(io.io_type == DATA_CHANNEL)
|
||||
io.write_data_to_pin(data_to_write)
|
||||
to_chat(user, "<span class='notice'>You write '[data_to_write ? data_to_write : "NULL"]' to the '[io]' pin of \the [io.holder].</span>")
|
||||
var/data_to_show = data_to_write
|
||||
if(isweakref(data_to_write))
|
||||
var/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>")
|
||||
else if(io.io_type == PULSE_CHANNEL)
|
||||
io.holder.check_then_do_work()
|
||||
to_chat(user, "<span class='notice'>You pulse \the [io.holder]'s [io].</span>")
|
||||
|
||||
Reference in New Issue
Block a user