From e24b26c7e6ed6b66effc6bbec54063846f23af70 Mon Sep 17 00:00:00 2001 From: DeltaFire Date: Wed, 18 Nov 2020 22:47:28 +0100 Subject: [PATCH 1/3] fixes APCs using nearly no power --- code/modules/power/apc.dm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 7f7c02f457..65ff1c93ee 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1373,9 +1373,9 @@ // next: take from or charge to the cell, depending on how much is left if(cell && !shorted) if(cur_excess > 0) - var/charging_cell = min(cur_excess, cell.maxcharge * GLOB.CHARGELEVEL) + var/charging_cell = min(cur_excess*GLOB.CELLRATE, cell.maxcharge * GLOB.CHARGELEVEL) cell.give(charging_cell) - add_load(charging_cell) + add_load(charging_cell/GLOB.cellrate) lastused_total += charging_cell longtermpower = min(10,longtermpower + 1) if(chargemode && !charging) From adc2af2dde6289c12a484abadeb7ba7b834182a2 Mon Sep 17 00:00:00 2001 From: DeltaFire Date: Wed, 18 Nov 2020 22:51:54 +0100 Subject: [PATCH 2/3] typo --- code/modules/power/apc.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index 65ff1c93ee..ae3dc7189e 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1375,7 +1375,7 @@ if(cur_excess > 0) var/charging_cell = min(cur_excess*GLOB.CELLRATE, cell.maxcharge * GLOB.CHARGELEVEL) cell.give(charging_cell) - add_load(charging_cell/GLOB.cellrate) + add_load(charging_cell/GLOB.CELLRATE) lastused_total += charging_cell longtermpower = min(10,longtermpower + 1) if(chargemode && !charging) From ac20bb7d8c4c5f493211278f507910223c2ef718 Mon Sep 17 00:00:00 2001 From: DeltaFire Date: Tue, 24 Nov 2020 19:43:14 +0100 Subject: [PATCH 3/3] fixes up a tiiny cell charge oversight --- code/modules/power/apc.dm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/code/modules/power/apc.dm b/code/modules/power/apc.dm index ae3dc7189e..ca2c259bb5 100644 --- a/code/modules/power/apc.dm +++ b/code/modules/power/apc.dm @@ -1373,7 +1373,7 @@ // next: take from or charge to the cell, depending on how much is left if(cell && !shorted) if(cur_excess > 0) - var/charging_cell = min(cur_excess*GLOB.CELLRATE, cell.maxcharge * GLOB.CHARGELEVEL) + var/charging_cell = min(min(cur_excess*GLOB.CELLRATE, cell.maxcharge * GLOB.CHARGELEVEL), cell.maxcharge - cell.charge) cell.give(charging_cell) add_load(charging_cell/GLOB.CELLRATE) lastused_total += charging_cell