From 5b092ebe1d3bee70b0baaf5d88879984f809d5f0 Mon Sep 17 00:00:00 2001 From: "DESKTOP-MMO982B\\User" <752966621@qq.com> Date: Fri, 22 Aug 2025 15:26:16 +0800 Subject: [PATCH 1/3] 1 --- .../Modules/UpGradePackage/UpGradePackagePanel.lua | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua b/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua index 860dabaad1..5620e9134d 100644 --- a/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua @@ -165,19 +165,29 @@ end function this:SetCurTypeAndIndex() curType = OperatingManager.upGradePackagePanelType and OperatingManager.upGradePackagePanelType or 1 curIndex = OperatingManager.upGradePackagePanelIndex and OperatingManager.upGradePackagePanelIndex or 0 + if curGiftList[curType] and #curGiftList[curType] > 0 and curGiftList[curType][curIndex] then elseif curGiftList[curType] and #curGiftList[curType] > 0 and (not curGiftList[curType][curIndex]) then - curIndex = #curGiftList[curType] + urIndex = #curGiftList[curType]/2+1 + if curIndex > #curGiftList[curType] then + curIndex = #curGiftList[curType] + end + LogError("推送礼包类型:"..tostring(curType).." 推送礼包index:"..tostring(curIndex)) return curGiftList[curType][curIndex] else for k,v in pairs(curGiftList) do if v and #v > 0 then curType = k - curIndex = #curGiftList[curType] + curIndex = #curGiftList[curType]/2+1 + if curIndex > #curGiftList[curType] then + curIndex = #curGiftList[curType] + end + LogError("推送礼包类型:"..tostring(curType).." 推送礼包index:"..tostring(curIndex)) return curGiftList[curType][curIndex] end end end + LogError("推送礼包类型:"..tostring(curType).." 推送礼包index:"..tostring(curIndex)) return curGiftList[curType][curIndex] end From eef2d8be9c905be7ae9eccf4b36a825feda24ca8 Mon Sep 17 00:00:00 2001 From: "DESKTOP-MMO982B\\User" <752966621@qq.com> Date: Fri, 22 Aug 2025 16:07:49 +0800 Subject: [PATCH 2/3] 1 --- .../~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua b/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua index 5620e9134d..49ab8b0cf5 100644 --- a/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua @@ -168,7 +168,7 @@ function this:SetCurTypeAndIndex() if curGiftList[curType] and #curGiftList[curType] > 0 and curGiftList[curType][curIndex] then elseif curGiftList[curType] and #curGiftList[curType] > 0 and (not curGiftList[curType][curIndex]) then - urIndex = #curGiftList[curType]/2+1 + curIndex = #curGiftList[curType]/2+1 if curIndex > #curGiftList[curType] then curIndex = #curGiftList[curType] end From 98425e14186a2d5bbff24707234d810671500688 Mon Sep 17 00:00:00 2001 From: "DESKTOP-MMO982B\\User" <752966621@qq.com> Date: Fri, 22 Aug 2025 16:10:22 +0800 Subject: [PATCH 3/3] 1 --- .../~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua b/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua index 49ab8b0cf5..3e86d96e0b 100644 --- a/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua +++ b/Assets/ManagedResources/~Lua/Modules/UpGradePackage/UpGradePackagePanel.lua @@ -168,7 +168,7 @@ function this:SetCurTypeAndIndex() if curGiftList[curType] and #curGiftList[curType] > 0 and curGiftList[curType][curIndex] then elseif curGiftList[curType] and #curGiftList[curType] > 0 and (not curGiftList[curType][curIndex]) then - curIndex = #curGiftList[curType]/2+1 + curIndex = math.floor(#curGiftList[curType]/2+1) if curIndex > #curGiftList[curType] then curIndex = #curGiftList[curType] end @@ -178,7 +178,7 @@ function this:SetCurTypeAndIndex() for k,v in pairs(curGiftList) do if v and #v > 0 then curType = k - curIndex = #curGiftList[curType]/2+1 + curIndex = math.floor(#curGiftList[curType]/2+1) if curIndex > #curGiftList[curType] then curIndex = #curGiftList[curType] end