镇念塔:修复派遣任务无奖励显示

This commit is contained in:
luying
2021-08-19 17:16:18 +08:00
parent 76fa1104fc
commit 6adeda82dc
4 changed files with 27 additions and 8 deletions
+8 -5
View File
@@ -85,7 +85,7 @@ export async function getTasks(role: RoleType) {
let { roleId, roleName, towerLv, towerTaskRefTime, towerTaskReCnt = 0 } = role;
// towerLv:从1开始,下次打得层数,dicParam内的:从0开始,打过的层数
if(towerLv - 1 <= dicParam.TOWER_SEARCH.TOWER_SEARCH_STARTLIMITED) {
if(towerLv - 1 < dicParam.TOWER_SEARCH.TOWER_SEARCH_STARTLIMITED) {
return {curTasks: [], refRemainTime: 0, nextCostGold: 0}
}
@@ -415,16 +415,17 @@ export async function refreshTasks(towerLv: number, batchCode: string, roleId: s
for(let i = 1; i <= dicParam.TOWER_SEARCH.TOWER_SEARCH_LIMITED; i++) {
positions.set(i, null);
}
let tasks: TowerTaskRecType[] = [];
for(let task of oldTasks) {
if( task.status == TOWER_TASK_STATUS.WAITING ) {
positions.set(task.position, task);
} else {
positions.delete(task.position);
ridTaskIds.push(task.taskId);
tasks.push(task);
}
}
let tasks: TowerTaskRecType[] = [];
for(let [ position, task ] of positions) {
let dicOldTask = task? gameData.towerTask.get(task.taskId): null;
@@ -506,12 +507,14 @@ export function getRemainTime(curTime: Date) {
return Math.floor((nextTime - curTime.getTime()) / 1000);
}
export function treatTask(recs: Array<any>, curTime: Date) {
export function treatTask(recs: Array<TowerTaskRecType>, curTime: Date) {
return recs.map(cur => {
let { heroes, batchCode, taskId, taskCode, status, completeTime } = cur;
let { heroes, batchCode, taskId, taskCode, status, completeTime, position } = cur;
let getStatusResult = getTaskStatus(status, completeTime, curTime);
return { heroes, batchCode, taskId, taskCode, completeTime, ...getStatusResult }
return { position, heroes, batchCode, taskId, taskCode, completeTime, ...getStatusResult }
}).sort((a, b) => {
return a.position - b.position;
});
}