Code style

This commit is contained in:
Continuities
2015-08-02 11:40:27 -04:00
parent 64f6797c3e
commit a0b343246c
+6 -7
View File
@@ -901,19 +901,18 @@ var Room = {
.addClass('row_val') .addClass('row_val')
.text(Engine.getIncomeMsg(income.stores[store], income.delay)) .text(Engine.getIncomeMsg(income.stores[store], income.delay))
.appendTo(tt); .appendTo(tt);
if (totalIncome[store] === undefined || totalIncome[store]['income'] === undefined) { if (!totalIncome[store] || totalIncome[store].income === undefined) {
totalIncome[store] = {}; totalIncome[store] = { income: 0 };
totalIncome[store]['income'] = 0;
} }
totalIncome[store]['income'] += Number(income.stores[store]); totalIncome[store].income += Number(income.stores[store]);
totalIncome[store]['delay'] = income.delay; totalIncome[store].delay = income.delay;
} }
} }
} }
if(tt.children().length > 0) { if(tt.children().length > 0) {
var total = totalIncome[storeName]['income']; var total = totalIncome[storeName].income;
$('<div>').addClass('total row_key').text(_('total')).appendTo(tt); $('<div>').addClass('total row_key').text(_('total')).appendTo(tt);
$('<div>').addClass('total row_val').text(Engine.getIncomeMsg(total, totalIncome[storeName]['delay'])).appendTo(tt); $('<div>').addClass('total row_val').text(Engine.getIncomeMsg(total, totalIncome[storeName].delay)).appendTo(tt);
tt.appendTo(el); tt.appendTo(el);
} }
}); });