Fixes a bug where dead crew are counted towards cryo/lifesup usage
This commit is contained in:
parent
0981d93619
commit
6238f8b1e3
10
index.html
10
index.html
|
@ -502,8 +502,14 @@ function updateUI() {
|
||||||
}
|
}
|
||||||
|
|
||||||
function updateStats() {
|
function updateStats() {
|
||||||
var numActive = frozen.filter(x => !x).length;
|
var numActive = 0;
|
||||||
var numFrozen = frozen.filter(x => x).length;
|
var numFrozen = 0;
|
||||||
|
for (var i = 0; i < CREW; i++) {
|
||||||
|
if (health[i] > 0 && frozen[i])
|
||||||
|
numFrozen += 1;
|
||||||
|
if (health[i] > 0 && !frozen[i])
|
||||||
|
numActive += 1;
|
||||||
|
}
|
||||||
$("#stat-crew-cryo").text(numFrozen);
|
$("#stat-crew-cryo").text(numFrozen);
|
||||||
$("#stat-crew-active").text(numActive);
|
$("#stat-crew-active").text(numActive);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue