From cae7f99b3e95f9a399235ce97ac11ea47c89db85 Mon Sep 17 00:00:00 2001 From: Buhallin Date: Mon, 6 Mar 2023 22:58:33 -0800 Subject: [PATCH 1/2] Handle duplicate connections Some icon/ability combinations on locations results in duplicate connections. The connection logic was parsing this as both a bidirectional and one-way connection, resulting in a one-way being drawn when it shouldn't be. This adds a simple check to recommit an existing bidirectional connection, rather than drawing a new one-way for it. --- src/core/PlayArea.ttslua | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index ad422fae..679bde8c 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -286,7 +286,8 @@ function buildConnection(cardId, iconCardList) for _, connectedGuid in ipairs(iconCardList[icon]) do -- If the reciprocal exists, convert it to BiDi, otherwise add as a one-way if locationConnections[connectedGuid] ~= nil - and locationConnections[connectedGuid][card.getGUID()] == ONE_WAY then + and (locationConnections[connectedGuid][card.getGUID()] == ONE_WAY + or locationConnections[connectedGuid][card.getGUID()] == BIDIRECTIONAL) then locationConnections[connectedGuid][card.getGUID()] = BIDIRECTIONAL locationConnections[card.getGUID()][connectedGuid] = nil else From f7587133a472d8d344cd764d76e18ae568841cb6 Mon Sep 17 00:00:00 2001 From: Buhallin Date: Mon, 6 Mar 2023 23:05:14 -0800 Subject: [PATCH 2/2] Format fix --- src/core/PlayArea.ttslua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/PlayArea.ttslua b/src/core/PlayArea.ttslua index 679bde8c..7e42d78c 100644 --- a/src/core/PlayArea.ttslua +++ b/src/core/PlayArea.ttslua @@ -286,8 +286,8 @@ function buildConnection(cardId, iconCardList) for _, connectedGuid in ipairs(iconCardList[icon]) do -- If the reciprocal exists, convert it to BiDi, otherwise add as a one-way if locationConnections[connectedGuid] ~= nil - and (locationConnections[connectedGuid][card.getGUID()] == ONE_WAY - or locationConnections[connectedGuid][card.getGUID()] == BIDIRECTIONAL) then + and (locationConnections[connectedGuid][card.getGUID()] == ONE_WAY + or locationConnections[connectedGuid][card.getGUID()] == BIDIRECTIONAL) then locationConnections[connectedGuid][card.getGUID()] = BIDIRECTIONAL locationConnections[card.getGUID()][connectedGuid] = nil else