Fix npcs
This commit is contained in:
parent
4dd90b9860
commit
271d4ba171
1 changed files with 140 additions and 60 deletions
|
|
@ -83,7 +83,11 @@ export class Player extends PlayerBase {
|
|||
}
|
||||
|
||||
protected createCharacter() {
|
||||
super.createCharacter();
|
||||
const preferredCenter = this.playerContainer.players.find(
|
||||
(p) => p.character?.isAlive && p.team === this.team,
|
||||
)?.center;
|
||||
|
||||
super.createCharacter(preferredCenter ?? vec2.create());
|
||||
|
||||
this.objectsPreviouslyInViewArea.push(this.character!);
|
||||
this.queueCommandSend(new CreatePlayerCommand(this.character!));
|
||||
|
|
|
|||
Loading…
Reference in a new issue