修复不扣血的问题
This commit is contained in:
parent
f5df7f7cc5
commit
e0bdb5eacf
@ -66,6 +66,9 @@ export class PetHandler {
|
||||
this._id = id || 0;
|
||||
this._cfg = CfgMan.findUnitCfg(this._id);
|
||||
|
||||
if(!this._cfg){
|
||||
console.log('[error]no cfg:' + this._id);
|
||||
}
|
||||
this._exredhurt = this._cfg.defense / 100;
|
||||
this._enmagic = this._cfg.spell_power;
|
||||
|
||||
@ -240,9 +243,10 @@ export class PetHandler {
|
||||
this._baseap += value;
|
||||
if(this._baseap <= 0){
|
||||
if(this._isHero){
|
||||
let tmp = this._baseap;
|
||||
this._baseap = 0;
|
||||
this.dataChanged();
|
||||
this.addHP(this._baseap);
|
||||
this.addHP(tmp);
|
||||
}else{
|
||||
this.die();
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user