diff --git a/script/room.js b/script/room.js index 5be65d3..a6c543b 100644 --- a/script/room.js +++ b/script/room.js @@ -797,6 +797,7 @@ var Room = { $SM.set('stores["'+k+'"]', 0); } + k = _(k); // thieves? if(typeof $SM.get('game.thieves') == 'undefined' && num > 5000 && $SM.get('features.location.world')) { @@ -805,21 +806,21 @@ var Room = { if(row.length === 0 && num > 0) { row = $('
').attr('id', id).addClass('storeRow'); - $('
').addClass('row_key').text(_(k)).appendTo(row); + $('
').addClass('row_key').text(k).appendTo(row); $('
').addClass('row_val').text(Math.floor(num)).appendTo(row); $('
').addClass('clear').appendTo(row); var curPrev = null; location.children().each(function(i) { var child = $(this); - var cName = child.attr('id').substring(4).replace('-', ' '); - if(cName < k && (curPrev == null || cName > curPrev)) { - curPrev = cName; + var cName = child.children('.row_key').text(); + if(cName < k) { + curPrev = child.attr('id'); } }); if(curPrev == null) { row.prependTo(location); } else { - row.insertAfter(location.find('#row_' + curPrev.replace(' ', '-'))); + row.insertAfter(location.find('#' + curPrev)); } newRow = true; } else if(num>= 0){