修复不死问题

This commit is contained in:
y.x 2020-12-29 12:17:09 +08:00
parent 92841345c7
commit ad82682852
3 changed files with 3 additions and 3 deletions

View File

@ -498,8 +498,6 @@ export class BattleHandler {
return; return;
} }
sp.srcplayer && sp.srcplayer.onUseCardEnd(sp); sp.srcplayer && sp.srcplayer.onUseCardEnd(sp);
this.checkPets();
}; };
/** /**
@ -548,6 +546,7 @@ export class BattleHandler {
public onPlayerRoundEnd(aplayer: Player){ public onPlayerRoundEnd(aplayer: Player){
let ph = this.getPlayer(aplayer); let ph = this.getPlayer(aplayer);
ph && ph.onRoundEnd(); ph && ph.onRoundEnd();
this.checkPets();
}; };
/** /**

View File

@ -262,6 +262,7 @@ export class PetHandler {
this.dataChanged(); this.dataChanged();
this.addHP(tmp); this.addHP(tmp);
}else{ }else{
this.dataChanged();
this.die(); this.die();
} }
}else{ }else{

View File

@ -658,7 +658,7 @@ export class PlayerHandler {
}; };
checkPets(breset: boolean = false){ checkPets(breset: boolean = false){
for(let i = this._pets.length - 1; i > 0; i--){ for(let i = this._pets.length - 1; i >= 0; i--){
let pet = this._pets[i]; let pet = this._pets[i];
if(pet && !pet.isAlive()){ if(pet && !pet.isAlive()){
this.delPet(pet); this.delPet(pet);