Skip to content

Commit

Permalink
Merge pull request #6182 from TracentEden2/fix_traveling_merchant_tie…
Browse files Browse the repository at this point in the history
…_issue

[Lua] Fix traveling merchant conquest tie issue
  • Loading branch information
zach2good authored Aug 27, 2024
2 parents 851ca04 + d546b9a commit 5eb102d
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions scripts/globals/conquest.lua
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down

0 comments on commit 5eb102d

Please sign in to comment.