Skip to content

Commit

Permalink
Fix ppt percentage for unset localcurrency (#3363)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjpalpha authored Oct 9, 2023
1 parent a4dca33 commit 1a39cb6
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions components/prize_pool/commons/prize_pool_base.lua
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,12 @@ BasePrizePool.prizeTypes = {

row = 'percentage',
rowParse = function (placement, input, context, index)
return BasePrizePool._parseInteger(input)
local value = BasePrizePool._parseInteger(input)
if value then
placement.hasPercentage = true
end

return value
end,
rowDisplay = function (headerData, data)
if String.isNotEmpty(data) then
Expand Down Expand Up @@ -745,7 +750,7 @@ end
-- or if there is a money reward in another currency whilst currency conversion is active
function BasePrizePool:_hasBaseCurrency()
return (Array.any(self.placements, function (placement)
return placement.hasBaseCurrency
return placement.hasBaseCurrency or placement.hasPercentage
end)) or (self.options.autoExchange and Array.any(self.prizes, function (prize)
return prize.type == PRIZE_TYPE_LOCAL_CURRENCY
end))
Expand Down

0 comments on commit 1a39cb6

Please sign in to comment.