COrrection XP competence/sort/carac et chiffres astro
This commit is contained in:
		| @@ -810,7 +810,8 @@ export class RdDActor extends Actor { | ||||
|     if (caracName == 'Taille') { | ||||
|       return; | ||||
|     } | ||||
|     await this.update({ [`data.carac.${caracName}.xp`]: caracXP ?? 0 }); | ||||
|     // if ( isNaN(caracXP)  || typeof(caracXP) != 'number') caracXP = 0; | ||||
|     //await this.update({ [`data.carac.${caracName}.xp`]: caracXP }); | ||||
|     this.checkCaracXP(caracName); | ||||
|   } | ||||
|  | ||||
| @@ -896,7 +897,7 @@ export class RdDActor extends Actor { | ||||
|   async updateCompetenceXP(compName, newXp) { | ||||
|     let comp = this.getCompetence(compName); | ||||
|     if (comp) { | ||||
|       newXp = newXp ?? 0; | ||||
|       if ( isNaN(newXp)  || typeof(newXp) != 'number') newXp = 0; | ||||
|       this.checkCompetenceXP(compName, newXp); | ||||
|       const update = { _id: comp.id, 'data.xp': newXp }; | ||||
|       await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity | ||||
| @@ -911,7 +912,7 @@ export class RdDActor extends Actor { | ||||
|   async updateCompetenceXPSort(compName, compValue) { | ||||
|     let comp = this.getCompetence(compName); | ||||
|     if (comp) { | ||||
|       compValue = compValue ?? 0; | ||||
|       if ( isNaN(compValue)  || typeof(compValue) != 'number') compValue = 0; | ||||
|       const update = { _id: comp.id, 'data.xp_sort': compValue }; | ||||
|       await this.updateEmbeddedDocuments('Item', [update]); // Updates one EmbeddedEntity | ||||
|       this.updateExperienceLog("XP Sort", compValue, "XP modifié en sort de " + compName); | ||||
|   | ||||
		Reference in New Issue
	
	Block a user