From a0b343246c46202a830ed2b4980c2cd2ed439c9d Mon Sep 17 00:00:00 2001 From: Continuities Date: Sun, 2 Aug 2015 11:40:27 -0400 Subject: [PATCH] Code style --- script/room.js | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/script/room.js b/script/room.js index a7b3f90..d569154 100644 --- a/script/room.js +++ b/script/room.js @@ -901,19 +901,18 @@ var Room = { .addClass('row_val') .text(Engine.getIncomeMsg(income.stores[store], income.delay)) .appendTo(tt); - if (totalIncome[store] === undefined || totalIncome[store]['income'] === undefined) { - totalIncome[store] = {}; - totalIncome[store]['income'] = 0; + if (!totalIncome[store] || totalIncome[store].income === undefined) { + totalIncome[store] = { income: 0 }; } - totalIncome[store]['income'] += Number(income.stores[store]); - totalIncome[store]['delay'] = income.delay; + totalIncome[store].income += Number(income.stores[store]); + totalIncome[store].delay = income.delay; } } } if(tt.children().length > 0) { - var total = totalIncome[storeName]['income']; + var total = totalIncome[storeName].income; $('
').addClass('total row_key').text(_('total')).appendTo(tt); - $('
').addClass('total row_val').text(Engine.getIncomeMsg(total, totalIncome[storeName]['delay'])).appendTo(tt); + $('
').addClass('total row_val').text(Engine.getIncomeMsg(total, totalIncome[storeName].delay)).appendTo(tt); tt.appendTo(el); } });