UIChatView:读取聊天记录的无限循环Bug

This commit is contained in:
fatiao 2025-09-23 17:06:10 +08:00
parent 691fdd1f5d
commit 942a523b90
2 changed files with 5 additions and 2 deletions

View File

@ -253,6 +253,7 @@ function UIChatCtr:GetStoryChatDatas(storyId, currStoryPerformCfgId)
local tmpStoryId = storyId
local allStoryList = {}
while storyRecordDatas[tmpStoryId] ~= nil do
local hasNextStory = false
table.insert(allStoryList, tmpStoryId)
local storyCfg = ManagerContainer.CfgMgr:GetStoryDataById(tmpStoryId)
if storyCfg.SelectionNext and #storyCfg.SelectionNext > 0 then
@ -260,9 +261,11 @@ function UIChatCtr:GetStoryChatDatas(storyId, currStoryPerformCfgId)
local id = storyCfg.SelectionNext[i]
if storyRecordDatas[id] then
tmpStoryId = id
hasNextStory = true
end
end
else
end
if hasNextStory == false then
break
end
end

View File

@ -140,7 +140,7 @@ function UIChatView:OnChatLayer2BtnSend()
self.sendPerformStoryCfgId = 0
else
local chatDataType = Enum.ChatDataType.Private
if self.currChatChannelId = CONST_CHANNEL_WORLD then
if self.currChatChannelId == CONST_CHANNEL_WORLD then
chatDataType = Enum.ChatDataType.World
elseif self.currChatChannelId == CONST_CHANNEL_GUILD then
chatDataType = Enum.ChatDataType.Guild