fix: fix APC behavior in unpowered areas (#25642)

* fix: make unpowered areas without APCs actually unpowered

* Update code/modules/power/powernets/local_powernet.dm

Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com>
Signed-off-by: warriorstar-orion <orion@snowfrost.garden>

---------

Signed-off-by: warriorstar-orion <orion@snowfrost.garden>
Co-authored-by: 1080pCat <96908085+1080pCat@users.noreply.github.com>
This commit is contained in:
warriorstar-orion
2024-05-30 15:22:10 +00:00
committed by GitHub
co-authored by 1080pCat
parent 37b08619b0
commit 5a2fd048b1
5 changed files with 15 additions and 9 deletions
+7 -3
View File
@@ -166,8 +166,15 @@
/obj/machinery/power/apc/Initialize(mapload)
. = ..()
var/area/A = get_area(src)
if(A.powernet && !A.powernet.powernet_apc)
A.powernet.powernet_apc = src
if(!mapload)
return
electronics_state = APC_ELECTRONICS_SECURED
// is starting with a power cell installed, create it and set its charge level
if(cell_type)
@@ -175,9 +182,6 @@
cell.maxcharge = cell_type // cell_type is maximum charge (old default was 1000 or 2500 (values one and two respectively)
cell.charge = start_charge * cell.maxcharge / 100 // (convert percentage to actual value)
var/area/A = get_area(src)
//if area isn't specified use current
if(keep_preset_name)
if(isarea(A))