Skip to content

Commit

Permalink
Refit - Fix a couple more CodeQL
Browse files Browse the repository at this point in the history
  • Loading branch information
WeaverThree committed Nov 7, 2024
1 parent 388676a commit 1499dce
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions MekHQ/src/mekhq/campaign/parts/RefitStep.java
Original file line number Diff line number Diff line change
Expand Up @@ -169,17 +169,17 @@ public static RefitStep spcialOmniFixedRefit() {
isFixedEquipmentChange = false;
return;
} else {
int oldQuantity = oldAHS.getQuantity();
int newQuantity = newAHS.getQuantity();
int oldAHSQuant = oldAHS.getQuantity();
int newAHSQuant = newAHS.getQuantity();
AeroHeatSink deltaAHS = oldAHS.clone();
int delta = 0;
if (oldQuantity > newQuantity) {
delta = oldQuantity - newQuantity;
if (oldAHSQuant > newAHSQuant) {
delta = oldAHSQuant - newAHSQuant;
deltaAHS.setQuantity(delta);
type = RefitStepType.REMOVE_UNTRACKED_SINKS;
returnsPart = deltaAHS;
} else {
delta = newQuantity - oldQuantity;
delta = newAHSQuant - oldAHSQuant;
deltaAHS.setQuantity(delta);
type = RefitStepType.ADD_UNTRACKED_SINKS;
neededPart = deltaAHS;
Expand Down Expand Up @@ -209,17 +209,17 @@ public static RefitStep spcialOmniFixedRefit() {
isFixedEquipmentChange = false;
return;
} else {
int oldQuantity = oldHS.getQuantity();
int newQuantity = newHS.getQuantity();
int oldHSQuant = oldHS.getQuantity();
int newHSQuant = newHS.getQuantity();
EquipmentPart deltaHS = oldHS.clone();
int delta = 0;
if (oldQuantity > newQuantity) {
delta = oldQuantity - newQuantity;
if (oldHSQuant > newHSQuant) {
delta = oldHSQuant - newHSQuant;
deltaHS.setQuantity(delta);
type = RefitStepType.REMOVE_UNTRACKED_SINKS;
returnsPart = deltaHS;
} else {
delta = newQuantity - oldQuantity;
delta = newHSQuant - oldHSQuant;
deltaHS.setQuantity(delta);
type = RefitStepType.ADD_UNTRACKED_SINKS;
neededPart = deltaHS;
Expand Down

0 comments on commit 1499dce

Please sign in to comment.