diff --git a/src/rooms/logic/Handler/PetHandler.ts b/src/rooms/logic/Handler/PetHandler.ts index e4535ce..54e5806 100644 --- a/src/rooms/logic/Handler/PetHandler.ts +++ b/src/rooms/logic/Handler/PetHandler.ts @@ -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(); }