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
+4 -8
View File
@@ -12,10 +12,6 @@
var/obj/item/tank/bombtank = null //the second part of the bomb is a plasma tank
origin_tech = "materials=1;engineering=1"
/obj/item/onetankbomb/ComponentInitialize()
. = ..()
AddComponent(/datum/component/proximity_monitor)
/obj/item/onetankbomb/examine(mob/user)
. = ..()
. += bombtank.examine(user)
@@ -41,10 +37,10 @@
if(!I.use_tool(src, user, 0, volume = I.tool_volume))
return
to_chat(user, "<span class='notice'>You disassemble [src].</span>")
bombassembly.loc = user.loc
bombassembly.forceMove(user.loc)
bombassembly.master = null
bombassembly = null
bombtank.loc = user.loc
bombtank.forceMove(user.loc)
bombtank.master = null
bombtank = null
qdel(src)
@@ -119,11 +115,11 @@
R.bombassembly = S //Tell the bomb about its assembly part
S.master = R //Tell the assembly about its new owner
S.loc = R //Move the assembly out of the fucking way
S.forceMove(R) //Move the assembly out of the fucking way
R.bombtank = src //Same for tank
master = R
loc = R
forceMove(R)
R.update_icon()
return
+2 -4
View File
@@ -50,8 +50,6 @@
A2.holder = src
a_left = A1
a_right = A2
if(has_prox_sensors())
AddComponent(/datum/component/proximity_monitor)
name = "[A1.name]-[A2.name] assembly"
update_icon()
return TRUE
@@ -183,10 +181,10 @@
return FALSE
if(a_left)
a_left.holder = null
a_left.loc = T
a_left.forceMove(T)
if(a_right)
a_right.holder = null
a_right.loc = T
a_right.forceMove(T)
qdel(src)
+1 -1
View File
@@ -15,7 +15,7 @@
/obj/item/assembly/prox_sensor/ComponentInitialize()
. = ..()
AddComponent(/datum/component/proximity_monitor)
AddComponent(/datum/component/proximity_monitor, _always_active = TRUE)
/obj/item/assembly/prox_sensor/describe()
if(timing)