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