Fix update endurance/vie
Dans certains cas, les valeurs de vie/endurance n'étaient pas mises à jour
This commit is contained in:
		| @@ -11,7 +11,7 @@ export class RdDItemArmure extends RdDItem { | ||||
|     return "systems/foundryvtt-reve-de-dragon/icons/armes_armures/armure_plaques.webp"; | ||||
|   } | ||||
|  | ||||
|   deteriorerArmure(dmg) { | ||||
|   async deteriorerArmure(dmg) { | ||||
|     if (!ReglesOptionnelles.isUsing('deteriorationArmure') || this.system.protection == '0') { | ||||
|       return; | ||||
|     } | ||||
| @@ -23,12 +23,10 @@ export class RdDItemArmure extends RdDItem { | ||||
|       protection = this.calculProtectionDeterioree(); | ||||
|       ChatMessage.create({ content: `Votre armure ${this.name} s'est détériorée, elle protège maintenant de ${protection}` }); | ||||
|     } | ||||
|     this.update({ | ||||
|       system: { | ||||
|         deterioration: deterioration, | ||||
|         protection: protection | ||||
|       } | ||||
|     }); | ||||
|     await this.update({ | ||||
|       'system.deterioration': deterioration, | ||||
|       'system.protection': protection | ||||
|     }) | ||||
|   } | ||||
|  | ||||
|   calculProtectionDeterioree() { | ||||
|   | ||||
		Reference in New Issue
	
	Block a user