Skip to content

Commit 2d56283

Browse files
committed
Change the formula for degreeOfChange so that
temporaryPrisonerCapacity can recover for very low values
1 parent 09b6854 commit 2d56283

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

MekHQ/src/mekhq/campaign/randomEvents/prisoners/PrisonerEventManager.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
*/
2828
package mekhq.campaign.randomEvents.prisoners;
2929

30+
import static java.lang.Math.abs;
3031
import static java.lang.Math.max;
3132
import static java.lang.Math.min;
3233
import static java.lang.Math.round;
@@ -178,7 +179,8 @@ int degradeTemporaryCapacity() {
178179
int newCapacity = 0;
179180

180181
if (temporaryCapacityModifier != DEFAULT_TEMPORARY_CAPACITY) {
181-
int degreeOfChange = (int) round(temporaryCapacityModifier * TEMPORARY_CAPACITY_DEGRADE_RATE);
182+
int differendInTemporaryCapacity = abs(DEFAULT_TEMPORARY_CAPACITY-temporaryCapacityModifier);
183+
int degreeOfChange = (int) min(1,round(differendInTemporaryCapacity * TEMPORARY_CAPACITY_DEGRADE_RATE));
182184

183185
if (temporaryCapacityModifier < DEFAULT_TEMPORARY_CAPACITY) {
184186
temporaryCapacityModifier += degreeOfChange;

0 commit comments

Comments
 (0)