From 122d8f4c737badbacbbea97ad3d9215bf7a51abb Mon Sep 17 00:00:00 2001 From: ezsh <ezsh.junk@gmail.com> Date: Mon, 20 May 2019 12:08:36 +0200 Subject: [PATCH] Fix interaction links for the New Game Plus listing Passing object to generate a call is stupid, we need the reference string here. Closes #755. --- src/js/slaveListing.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/js/slaveListing.js b/src/js/slaveListing.js index eb0c8bc8bad..a10e724c34c 100644 --- a/src/js/slaveListing.js +++ b/src/js/slaveListing.js @@ -482,7 +482,8 @@ App.UI.SlaveList.listNGPSlaves = function () { SlaveSort.indices(importedSlavesIndices); r += App.UI.tabbar.makeTab("remove", App.UI.SlaveList.render(importedSlavesIndices, [], (s) => `<u><strong><span class="pink">${SlaveFullName(s)}</span></strong></u>`, - (s) => App.UI.passageLink('Remove from import list', thisPassage, `$slavesToImport -= 1, removeJob(${s}, "${NGPassignment}")`))); + (s, i) => App.UI.passageLink('Remove from import list', thisPassage, + `$slavesToImport -= 1, removeJob(${App.Utils.slaveRefString(i)}, "${NGPassignment}")`))); } else { r += App.UI.tabbar.makeTab("remove", `<em>No slaves will go with you to the new game</em>`); } @@ -492,7 +493,8 @@ App.UI.SlaveList.listNGPSlaves = function () { SlaveSort.indices(slavesToImportIndices); r += App.UI.tabbar.makeTab("assign", App.UI.SlaveList.render(slavesToImportIndices, [], (s) => `<u><strong><span class="pink">${SlaveFullName(s)}</span></strong></u>`, - (s) => App.UI.passageLink('Add to import list', thisPassage, `$slavesToImport += 1, assignJob(${s}, "${NGPassignment}")`))); + (s, i) => App.UI.passageLink('Add to import list', thisPassage, + `$slavesToImport += 1, assignJob(${App.Utils.slaveRefString(i)}, "${NGPassignment}")`))); } else { r += App.UI.tabbar.makeTab("assign", `<strong>Slave import limit reached</strong>`); } -- GitLab