Updates the proximity monitor component (#15836)

* prox component update

* mochi review

* bug fix, makes proximity sensors always active

* GC fixes and removes an unused proc

* Disposal fixes from TM

* fixes runtimes when objects created in nullspace runtimes, fixes portable flasher

* a fresh perspective

* lewcc review

* adds comment about direct loc setting over forceMove
This commit is contained in:
SteelSlayer
2022-04-30 09:50:36 -05:00
committed by GitHub
parent da5ef366f1
commit e49b016df4
16 changed files with 524 additions and 145 deletions
@@ -62,8 +62,6 @@
to_chat(user, "<span class='notice'>You attach [A] to the valve controls and secure it.</span>")
A.holder = src
A.toggle_secure() //this calls update_icon(), which calls update_icon() on the holder (i.e. the bomb).
if(istype(attached_device, /obj/item/assembly/prox_sensor))
AddComponent(/datum/component/proximity_monitor)
investigate_log("[key_name(user)] attached a [A] to a transfer valve.", INVESTIGATE_BOMB)
add_attack_logs(user, src, "attached [A] to a transfer valve", ATKLOG_FEW)
@@ -139,7 +137,6 @@
attached_device.forceMove(get_turf(src))
attached_device.holder = null
attached_device = null
qdel(GetComponent(/datum/component/proximity_monitor))
update_icon()
else
. = FALSE
@@ -176,7 +176,7 @@
if(I.reagents.total_volume)
to_chat(user, "<span class='notice'>You add [I] to the assembly.</span>")
user.drop_item()
I.loc = src
I.forceMove(src)
beakers += I
else
to_chat(user, "<span class='notice'>[I] is empty.</span>")
@@ -190,10 +190,8 @@
user.drop_item()
nadeassembly = A
if(nadeassembly.has_prox_sensors())
AddComponent(/datum/component/proximity_monitor)
A.master = src
A.loc = src
A.forceMove(src)
assemblyattacher = user.ckey
stage = WIRED
to_chat(user, "<span class='notice'>You add [A] to [src]!</span>")
@@ -218,13 +216,12 @@
payload_name = null
label = null
if(nadeassembly)
nadeassembly.loc = get_turf(src)
nadeassembly.forceMove(get_turf(src))
nadeassembly.master = null
nadeassembly = null
qdel(GetComponent(/datum/component/proximity_monitor))
if(beakers.len)
for(var/obj/O in beakers)
O.loc = get_turf(src)
O.forceMove(get_turf(src))
beakers = list()
update_icon()
@@ -307,8 +304,6 @@
/obj/item/grenade/chem_grenade/proc/CreateDefaultTrigger(typekey)
if(ispath(typekey,/obj/item/assembly))
nadeassembly = new(src)
if(nadeassembly.has_prox_sensors())
AddComponent(/datum/component/proximity_monitor)
nadeassembly.a_left = new /obj/item/assembly/igniter(nadeassembly)
nadeassembly.a_left.holder = nadeassembly
nadeassembly.a_left.secured = 1