修复任务bug
This commit is contained in:
parent
0cb6c115cd
commit
a68579db48
@ -17,10 +17,10 @@ local function sortTask(taskList)
|
||||
if completeA then
|
||||
return a.id < b.id
|
||||
else -- 没有完成的优先显示战令解锁
|
||||
if a.bountyLock == b.bountyLock then
|
||||
if a.lock == b.lock then
|
||||
return a.id < b.id
|
||||
else
|
||||
return a.bountyLock
|
||||
return b.lock
|
||||
end
|
||||
end
|
||||
else
|
||||
|
||||
@ -46,6 +46,18 @@ function DailyTaskData:init(data)
|
||||
type = v.type,
|
||||
reset = v.reset
|
||||
}
|
||||
if v.bounty then
|
||||
if self.isUnlockBountyDailyTask then
|
||||
dailyTaskObj.lock = false
|
||||
else
|
||||
dailyTaskObj.lock = true
|
||||
end
|
||||
else
|
||||
dailyTaskObj.lock = false
|
||||
end
|
||||
if dailyTaskObj.lock then
|
||||
dailyTaskObj.redPoint = false
|
||||
else
|
||||
if not dailyTaskObj.claimed and dailyTaskObj.progress >= dailyTaskObj.needProgress then
|
||||
dailyTaskObj.redPoint = true
|
||||
if dailyTaskObj.type == 1 then
|
||||
@ -56,14 +68,6 @@ function DailyTaskData:init(data)
|
||||
else
|
||||
dailyTaskObj.redPoint = false
|
||||
end
|
||||
if v.bounty then
|
||||
if self.isUnlockBountyDailyTask then
|
||||
dailyTaskObj.lock = false
|
||||
else
|
||||
dailyTaskObj.lock = true
|
||||
end
|
||||
end
|
||||
if not dailyTaskObj.lock then -- 只有解锁的任务才注册监听任务进度
|
||||
local list = self.taskTypeMap[taskInfo.type]
|
||||
if list == nil then
|
||||
list = {}
|
||||
@ -130,11 +134,11 @@ function DailyTaskData:refreshDailyTask(task)
|
||||
dailyTaskObj.type = dailyTaskInfo.type
|
||||
dailyTaskObj.reset = dailyTaskInfo.reset
|
||||
local redPoint = false
|
||||
if not dailyTaskObj.claimed and dailyTaskObj.progress >= dailyTaskObj.needProgress then
|
||||
if not dailyTaskObj.lock and not dailyTaskObj.claimed and dailyTaskObj.progress >= dailyTaskObj.needProgress then
|
||||
redPoint = true
|
||||
end
|
||||
local originTaskType = originTaskInfo.type
|
||||
if originTaskType ~= taskInfo.type then -- 任务类型变了
|
||||
if not dailyTaskObj.lock and originTaskType ~= taskInfo.type then -- 任务类型变了
|
||||
self:unregisterTask(id, originTaskType)
|
||||
self:registerTask(dailyTaskObj, taskInfo.type)
|
||||
end
|
||||
@ -307,6 +311,9 @@ function DailyTaskData:getIfCanClaimTask(task)
|
||||
end
|
||||
|
||||
function DailyTaskData:addTaskProgress(task, taskType, count)
|
||||
if task.lock then
|
||||
return
|
||||
end
|
||||
local currProgress = task.progress
|
||||
if currProgress >= task.needProgress then
|
||||
return
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user