fixed potential integer overflow
This commit is contained in:
parent
3d3085dd06
commit
2c5c282f2f
1 changed files with 1 additions and 1 deletions
|
@ -247,7 +247,7 @@ public class PipeTransportPower extends PipeTransport {
|
||||||
|
|
||||||
if (totalPowerConsumed > 0) {
|
if (totalPowerConsumed > 0) {
|
||||||
for (int in = 0; in < 6; ++in) {
|
for (int in = 0; in < 6; ++in) {
|
||||||
int powerConsumed = internalPower[in] * totalPowerConsumed / totalPowerContained;
|
int powerConsumed = (int) ((double) internalPower[in] * (double) totalPowerConsumed / totalPowerContained);
|
||||||
displayPower[in] += powerConsumed;
|
displayPower[in] += powerConsumed;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue