成长礼包屏蔽满级状态

This commit is contained in:
CloudJ 2023-06-06 12:00:45 +08:00
parent 062d3e54e8
commit 2c4aec0178

View File

@ -682,10 +682,16 @@ function ShopData:getValidGrowUpGifts()
local triggerTime = gift.trigger_at // 1000 local triggerTime = gift.trigger_at // 1000
local maxDurationTime = triggerTime + durationTime local maxDurationTime = triggerTime + durationTime
local buyLimit = cfgInfo.limit or 0 local buyLimit = cfgInfo.limit or 0
-- 是否英雄已满级
local isMaxLv = false
local heroId = cfgInfo.hero_id
local heroEntity = DataManager.HeroData:getHeroById(heroId)
if heroEntity then
isMaxLv = heroEntity:isMaxLv()
end
-- 是否在有效范围内 -- 是否在有效范围内
local isInDurationTime = Time:getServerTime() < maxDurationTime local isInDurationTime = Time:getServerTime() < maxDurationTime
if isInDurationTime then if not isMaxLv and isInDurationTime then
-- 如果是最后一档 默认有效 -- 如果是最后一档 默认有效
if cfgInfo.last then if cfgInfo.last then
isValid = true isValid = true