mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Merge pull request #2578 from CHOMPStationBot/upstream-merge-11132
[MIRROR] Fixes #11129
This commit is contained in:
@@ -36,10 +36,10 @@
|
||||
/obj/machinery/power/smes/batteryrack/proc/add_parts()
|
||||
component_parts = list()
|
||||
component_parts += new /obj/item/weapon/circuitboard/batteryrack
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor/ // Capacitors: Maximal I/O
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor/
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor/
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin/ // Matter Bin: Max. amount of cells.
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor // Capacitors: Maximal I/O
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor
|
||||
component_parts += new /obj/item/weapon/stock_parts/capacitor
|
||||
component_parts += new /obj/item/weapon/stock_parts/matter_bin // Matter Bin: Max. amount of cells.
|
||||
|
||||
/obj/machinery/power/smes/batteryrack/RefreshParts()
|
||||
var/capacitor_efficiency = 0
|
||||
@@ -61,6 +61,9 @@
|
||||
internal_cells = null
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/smes/batteryrack/check_terminals()
|
||||
return TRUE // we don't necessarily need terminals
|
||||
|
||||
/obj/machinery/power/smes/batteryrack/update_icon()
|
||||
cut_overlays()
|
||||
icon_update = 0
|
||||
|
||||
@@ -68,14 +68,8 @@ GLOBAL_LIST_EMPTY(smeses)
|
||||
/obj/machinery/power/smes/Initialize()
|
||||
. = ..()
|
||||
GLOB.smeses += src
|
||||
for(var/d in GLOB.cardinal)
|
||||
var/turf/T = get_step(src, d)
|
||||
for(var/obj/machinery/power/terminal/term in T)
|
||||
if(term && term.dir == turn(d, 180) && !term.master)
|
||||
terminals |= term
|
||||
term.master = src
|
||||
term.connect_to_network()
|
||||
if(!terminals.len)
|
||||
add_nearby_terminals()
|
||||
if(!check_terminals())
|
||||
stat |= BROKEN
|
||||
return
|
||||
update_icon()
|
||||
@@ -91,6 +85,20 @@ GLOBAL_LIST_EMPTY(smeses)
|
||||
GLOB.smeses -= src
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/smes/proc/add_nearby_terminals()
|
||||
for(var/d in GLOB.cardinal)
|
||||
var/turf/T = get_step(src, d)
|
||||
for(var/obj/machinery/power/terminal/term in T)
|
||||
if(term && term.dir == turn(d, 180) && !term.master)
|
||||
terminals |= term
|
||||
term.master = src
|
||||
term.connect_to_network()
|
||||
|
||||
/obj/machinery/power/smes/proc/check_terminals()
|
||||
if(!terminals.len)
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/machinery/power/smes/add_avail(var/amount)
|
||||
if(..(amount))
|
||||
powernet.smes_newavail += amount
|
||||
|
||||
Reference in New Issue
Block a user