From d546b9ac98a4e5ab7a36f007c5ec80aaf89de5c9 Mon Sep 17 00:00:00 2001 From: TracentEden <92269743+TracentEden@users.noreply.github.com> Date: Mon, 26 Aug 2024 23:35:29 +0300 Subject: [PATCH] Fix traveling merchant tie issue --- scripts/globals/conquest.lua | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/scripts/globals/conquest.lua b/scripts/globals/conquest.lua index 416b62d7b80..318b26d2c18 100644 --- a/scripts/globals/conquest.lua +++ b/scripts/globals/conquest.lua @@ -614,11 +614,12 @@ xi.conquest.toggleRegionalNPCs = function(zone) end) local firstPlaceZone = rankings[1][2] - local secondPlaceZone = rankings[2][2] + -- check if the first and second are both rank 1 (thus a tie) + local firstAndSecondTie = rankings[1][1] == rankings[2][1] if firstPlaceZone == id and - firstPlaceZone ~= secondPlaceZone + not firstAndSecondTie then print('Showing regional conquest NPCs in: ' .. zone:getName()) else @@ -637,7 +638,7 @@ xi.conquest.toggleRegionalNPCs = function(zone) -- If there is a clear winner, and not a tie, show the NPCs if id == firstPlaceZone and - firstPlaceZone ~= secondPlaceZone + not firstAndSecondTie then entity:setStatus(xi.status.NORMAL) end