Fixes a bug where dead crew are counted towards cryo/lifesup usage

This commit is contained in:
Jaculabilis 2017-07-30 16:35:58 -07:00
parent 0981d93619
commit 6238f8b1e3
1 changed files with 8 additions and 2 deletions

View File

@ -502,8 +502,14 @@ function updateUI() {
}
function updateStats() {
var numActive = frozen.filter(x => !x).length;
var numFrozen = frozen.filter(x => x).length;
var numActive = 0;
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-active").text(numActive);