军团活动:fix删除

This commit is contained in:
luying
2021-04-02 15:07:11 +08:00
parent 5a76b9a047
commit dafafae34e
3 changed files with 67 additions and 26 deletions

View File

@@ -104,18 +104,24 @@ export class WoodenHorse {
if(event.endDistance && event.startDistance == event.endDistance) {
isEffective = true;
}
delEvents.push(i);
let index = events.findIndex(cur => cur.id == event.id);
events.splice(index, 1);
}
if(isEffective) {
effectiveEvents.push(event);
}
}
for(let i of delEvents) events.splice(i, 1); // 删除过期事件
effectiveEvents.sort((a, b) => a.startTime - b.startTime);
this.speed = GUILDACTIVITY.RACE_INIT_SPEED + this.memberCnt * GUILDACTIVITY.RACE_PER_SPEED;
for(let { id, count, endTime } of effectiveEvents) {
this.calEvent(id, count, endTime);
}
if(this.durability <= 0) {
this.status = 0; // TODO 写进const表
this.speed = 0;
}
console.log('**effect', this.speed, JSON.stringify(effectiveEvents));
return false;
}
@@ -182,10 +188,6 @@ export class WoodenHorse {
}
break;
}
if(this.durability <= 0) {
this.status = 0; // TODO 写进const表
this.speed = 0;
}
}