Skip to content

Commit

Permalink
Weight calc correction, some utility
Browse files Browse the repository at this point in the history
  • Loading branch information
SJuliez committed Dec 21, 2023
1 parent 9489d66 commit af6286c
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 1 deletion.
5 changes: 5 additions & 0 deletions megamek/src/megamek/common/Entity.java
Original file line number Diff line number Diff line change
Expand Up @@ -11073,6 +11073,11 @@ public Engine getEngine() {
return engine;
}

/** @return The type of engine if it has an engine, or Engine.NONE, if it has no engine. */
public int getEngineType() {
return hasEngine() ? getEngine().getEngineType() : Engine.NONE;
}

public boolean hasEngine() {
return (null != engine);
}
Expand Down
8 changes: 8 additions & 0 deletions megamek/src/megamek/common/verifier/TestEntity.java
Original file line number Diff line number Diff line change
Expand Up @@ -1689,6 +1689,14 @@ boolean usesKgStandard() {
return usesKgStandard(getEntity());
}


public int totalCritSlotCount() {
int slotCount = 0;
for (int i = 0; i < getEntity().locations(); i++) {
slotCount += getEntity().getNumberOfCriticals(i);
}
return slotCount;
}
} // End class TestEntity

class Armor {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -720,7 +720,7 @@ public double calculateWeight() {

@Override
public double calculateWeightExact() {
return super.calculateWeight() + getFuelTonnage();
return super.calculateWeightExact() + getFuelTonnage();
}

@Override
Expand Down

0 comments on commit af6286c

Please sign in to comment.