From 12f1bb1de8b9525d401bdf1778af902f9d367972 Mon Sep 17 00:00:00 2001 From: Ty-Omaha Date: Mon, 15 Jul 2019 08:43:05 -0400 Subject: [PATCH 1/4] power --- code/modules/events/grid_check.dm | 4 ++++ code/modules/power/power.dm | 3 ++- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/code/modules/events/grid_check.dm b/code/modules/events/grid_check.dm index d8d1f46ad9b..18e8404cb3c 100644 --- a/code/modules/events/grid_check.dm +++ b/code/modules/events/grid_check.dm @@ -45,6 +45,8 @@ continue if(C.cell) C.cell.charge = 0 + for(var/obj/machinery/power/P in GLOB.machines) + P.malfunction = TRUE /proc/power_restore(var/announce = 1) var/list/skipped_areas = list(/area/turret_protected/ai) @@ -67,6 +69,8 @@ S.input_attempt = S.last_input_attempt S.update_icon() S.power_change() + for(var/obj/machinery/power/P in GLOB.machines) + P.malfunction = FALSE /proc/power_restore_quick(var/announce = 1) if(announce) diff --git a/code/modules/power/power.dm b/code/modules/power/power.dm index 33741d1475b..0ee03a2b272 100644 --- a/code/modules/power/power.dm +++ b/code/modules/power/power.dm @@ -15,6 +15,7 @@ use_power = NO_POWER_USE idle_power_usage = 0 active_power_usage = 0 + var/malfunction = FALSE /obj/machinery/power/Destroy() disconnect_from_network() @@ -30,7 +31,7 @@ // Non-machines should use add_delayedload(), delayed_surplus(), newavail() /obj/machinery/power/proc/add_avail(amount) - if(powernet) + if(powernet && !malfunction) powernet.newavail += amount return TRUE else From e042d114ddca1d231a1f7477dd6b16e1b1b40de6 Mon Sep 17 00:00:00 2001 From: Ty-Omaha Date: Mon, 15 Jul 2019 09:06:59 -0400 Subject: [PATCH 2/4] lol --- code/modules/events/grid_check.dm | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/code/modules/events/grid_check.dm b/code/modules/events/grid_check.dm index 18e8404cb3c..15b20c6286e 100644 --- a/code/modules/events/grid_check.dm +++ b/code/modules/events/grid_check.dm @@ -46,6 +46,9 @@ if(C.cell) C.cell.charge = 0 for(var/obj/machinery/power/P in GLOB.machines) + var/area/current_area = get_area(P) + if((current_area.type in skipped_areas_apc) || !is_station_level(P.z)) + continue P.malfunction = TRUE /proc/power_restore(var/announce = 1) @@ -70,6 +73,9 @@ S.update_icon() S.power_change() for(var/obj/machinery/power/P in GLOB.machines) + var/area/current_area = get_area(P) + if((current_area.type in skipped_areas_apc) || !is_station_level(P.z)) + continue P.malfunction = FALSE /proc/power_restore_quick(var/announce = 1) From b9d9b3c88d7b63c1d665a2ccdbec8bb0b7524c3d Mon Sep 17 00:00:00 2001 From: Ty-Omaha Date: Mon, 15 Jul 2019 09:10:00 -0400 Subject: [PATCH 3/4] k --- code/modules/events/grid_check.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/events/grid_check.dm b/code/modules/events/grid_check.dm index 15b20c6286e..a1668c58e3a 100644 --- a/code/modules/events/grid_check.dm +++ b/code/modules/events/grid_check.dm @@ -47,7 +47,7 @@ C.cell.charge = 0 for(var/obj/machinery/power/P in GLOB.machines) var/area/current_area = get_area(P) - if((current_area.type in skipped_areas_apc) || !is_station_level(P.z)) + if((current_area.type in skipped_areas_apc) || (current_area.type in skipped_areas) || !is_station_level(P.z)) continue P.malfunction = TRUE @@ -74,7 +74,7 @@ S.power_change() for(var/obj/machinery/power/P in GLOB.machines) var/area/current_area = get_area(P) - if((current_area.type in skipped_areas_apc) || !is_station_level(P.z)) + if((current_area.type in skipped_areas_apc) || (current_area.type in skipped_areas) || !is_station_level(P.z)) continue P.malfunction = FALSE From c8ccc3bb94fa3b420531d75d2602378db9f231eb Mon Sep 17 00:00:00 2001 From: Ty-Omaha Date: Mon, 15 Jul 2019 09:10:41 -0400 Subject: [PATCH 4/4] k 2 --- code/modules/events/grid_check.dm | 3 --- 1 file changed, 3 deletions(-) diff --git a/code/modules/events/grid_check.dm b/code/modules/events/grid_check.dm index a1668c58e3a..67881662db5 100644 --- a/code/modules/events/grid_check.dm +++ b/code/modules/events/grid_check.dm @@ -73,9 +73,6 @@ S.update_icon() S.power_change() for(var/obj/machinery/power/P in GLOB.machines) - var/area/current_area = get_area(P) - if((current_area.type in skipped_areas_apc) || (current_area.type in skipped_areas) || !is_station_level(P.z)) - continue P.malfunction = FALSE /proc/power_restore_quick(var/announce = 1)