forked from public/foundryvtt-reve-de-dragon
		
	Fix accorder entite de cauchemar
A priori vieille régression, pas vue depuis. attaquant._id est devenu attaquant.id
This commit is contained in:
		@@ -98,7 +98,6 @@ export class RdDActor extends Actor {
 | 
			
		||||
   * @param {Object} options     (Unused) Additional options which customize the creation workflow.
 | 
			
		||||
   *
 | 
			
		||||
   */
 | 
			
		||||
 | 
			
		||||
  static async create(actorData, options) {
 | 
			
		||||
    // Case of compendium global import
 | 
			
		||||
    if (actorData instanceof Array) {
 | 
			
		||||
@@ -135,13 +134,6 @@ export class RdDActor extends Actor {
 | 
			
		||||
    this.encTotal = 0;
 | 
			
		||||
    this.prixTotalEquipement = 0;
 | 
			
		||||
 | 
			
		||||
    /*
 | 
			
		||||
    // Auto-resize token
 | 
			
		||||
    if (this.isToken) {
 | 
			
		||||
      let tokenSize = actorData.data.carac.taille.value/10;
 | 
			
		||||
      this.token.update({height: tokenSize, width: tokenSize } );
 | 
			
		||||
    }*/
 | 
			
		||||
 | 
			
		||||
    // Make separate methods for each Actor type (character, npc, etc.) to keep
 | 
			
		||||
    // things organized.
 | 
			
		||||
    if (actorData.type === 'personnage') this._prepareCharacterData(actorData);
 | 
			
		||||
@@ -3593,7 +3585,7 @@ export class RdDActor extends Actor {
 | 
			
		||||
  isEntiteCauchemarAccordee(attaquant) {
 | 
			
		||||
    if (!this.isEntiteCauchemar()) { return true; }
 | 
			
		||||
    let resonnance = Misc.templateData(this).sante.resonnance;
 | 
			
		||||
    return (resonnance.actors.find(it => it == attaquant._id));
 | 
			
		||||
    return (resonnance.actors.find(it => it == attaquant.id));
 | 
			
		||||
  }
 | 
			
		||||
 | 
			
		||||
  /* -------------------------------------------- */
 | 
			
		||||
@@ -3603,11 +3595,11 @@ export class RdDActor extends Actor {
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    let resonnance = duplicate(Misc.templateData(this).sante.resonnance);
 | 
			
		||||
    if (resonnance.actors.find(it => it == attaquant._id)) {
 | 
			
		||||
    if (resonnance.actors.find(it => it == attaquant.id)) {
 | 
			
		||||
      // déjà accordé
 | 
			
		||||
      return;
 | 
			
		||||
    }
 | 
			
		||||
    resonnance.actors.push(attaquant._id);
 | 
			
		||||
    resonnance.actors.push(attaquant.id);
 | 
			
		||||
    await this.update({ "data.sante.resonnance": resonnance });
 | 
			
		||||
    return;
 | 
			
		||||
  }
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user