军团活动:fix删除
This commit is contained in:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user