mirror of
https://github.com/unanmed/HumanBreak.git
synced 2025-11-28 06:22:58 +08:00
fix: 移除跟随者
This commit is contained in:
parent
9a7fb25533
commit
4f02d166f2
@ -389,6 +389,7 @@ export class MapHeroRenderer implements IMapHeroRenderer {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (index === this.entities.length - 1) {
|
if (index === this.entities.length - 1) {
|
||||||
|
this.entities[index].block.destroy();
|
||||||
this.entities.splice(index, 1);
|
this.entities.splice(index, 1);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
@ -399,6 +400,7 @@ export class MapHeroRenderer implements IMapHeroRenderer {
|
|||||||
const moving = this.entities[i];
|
const moving = this.entities[i];
|
||||||
this.moveEntity(moving, last.nextDirection, DEFAULT_TIME);
|
this.moveEntity(moving, last.nextDirection, DEFAULT_TIME);
|
||||||
}
|
}
|
||||||
|
this.entities[index].block.destroy();
|
||||||
this.entities.splice(index, 1);
|
this.entities.splice(index, 1);
|
||||||
await Promise.all(this.entities.map(v => v.promise));
|
await Promise.all(this.entities.map(v => v.promise));
|
||||||
return;
|
return;
|
||||||
@ -421,10 +423,14 @@ export class MapHeroRenderer implements IMapHeroRenderer {
|
|||||||
moving.direction = last.nextDirection;
|
moving.direction = last.nextDirection;
|
||||||
moving.nextDirection = moving.direction;
|
moving.nextDirection = moving.direction;
|
||||||
}
|
}
|
||||||
|
this.entities[index].block.destroy();
|
||||||
this.entities.splice(index, 1);
|
this.entities.splice(index, 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
removeAllFollowers(): void {
|
removeAllFollowers(): void {
|
||||||
|
for (let i = 1; i < this.entities.length; i++) {
|
||||||
|
this.entities[i].block.destroy();
|
||||||
|
}
|
||||||
this.entities.length = 1;
|
this.entities.length = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -167,7 +167,7 @@ export class MovingBlock extends DynamicBlockStatus implements IMovingBlock {
|
|||||||
if (!this.end) return Promise.resolve(this);
|
if (!this.end) return Promise.resolve(this);
|
||||||
this.time = time;
|
this.time = time;
|
||||||
this.line = false;
|
this.line = false;
|
||||||
this.relative = false;
|
this.relative = true;
|
||||||
this.startX = this.x;
|
this.startX = this.x;
|
||||||
this.startY = this.y;
|
this.startY = this.y;
|
||||||
this.startTime = this.renderer.getTimestamp();
|
this.startTime = this.renderer.getTimestamp();
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user