mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-23 05:00:55 +01:00
[MIRROR] Cyborg inventory runtime fix. (#813)
* Cyborg inventory runtime fix. (#53741) Following the cyborg inventory refactor, code changed a bit. Cyborg inventory screens are inited in the HUD, however AI Shells don't generate a HUD until an AI assumes direct control. Damaging an AI shell before the AI created a HUD in it would cause runtimes as modules disabled and enabled. To remedy this, we now initialize the core inventory slots on the robit Init() and then update them as necessary in the HUD code later on if an AI ever deigns to grace your shell with their exalted presence instead of asking for it and then never using it. * Cyborg inventory runtime fix. Co-authored-by: Timberpoes <silent_insomnia_pp@hotmail.co.uk>
This commit is contained in:
@@ -114,6 +114,10 @@
|
||||
robot_modules_background.layer = HUD_LAYER //Objects that appear on screen are on layer ABOVE_HUD_LAYER, UI should be just below it.
|
||||
robot_modules_background.plane = HUD_PLANE
|
||||
|
||||
inv1 = new /obj/screen/robot/module1()
|
||||
inv2 = new /obj/screen/robot/module2()
|
||||
inv3 = new /obj/screen/robot/module3()
|
||||
|
||||
ident = rand(1, 999)
|
||||
|
||||
previous_health = health
|
||||
@@ -188,12 +192,12 @@
|
||||
if(T && istype(radio) && istype(radio.keyslot))
|
||||
radio.keyslot.forceMove(T)
|
||||
radio.keyslot = null
|
||||
qdel(wires)
|
||||
qdel(module)
|
||||
qdel(eye_lights)
|
||||
wires = null
|
||||
module = null
|
||||
eye_lights = null
|
||||
QDEL_NULL(wires)
|
||||
QDEL_NULL(module)
|
||||
QDEL_NULL(eye_lights)
|
||||
QDEL_NULL(inv1)
|
||||
QDEL_NULL(inv2)
|
||||
QDEL_NULL(inv3)
|
||||
cell = null
|
||||
return ..()
|
||||
|
||||
|
||||
Reference in New Issue
Block a user