Utilisation de get plutôt que find par id

This commit is contained in:
Vincent Vandemeulebrouck 2023-12-08 02:38:57 +01:00
parent 8e41250f64
commit ab9a21f402

View File

@ -515,7 +515,7 @@ export class RdDCombat {
static _callJetDeVie(event) { static _callJetDeVie(event) {
let actorId = event.currentTarget.attributes['data-actorId'].value; let actorId = event.currentTarget.attributes['data-actorId'].value;
let tokenId = event.currentTarget.attributes['data-tokenId'].value; let tokenId = event.currentTarget.attributes['data-tokenId'].value;
let token = canvas.tokens.placeables.find(t => t.id == tokenId) let token = canvas.tokens.get(tokenId)
const actor = token?.actor ?? game.actors.get(actorId); const actor = token?.actor ?? game.actors.get(actorId);
if (actor?.isOwner) { if (actor?.isOwner) {
actor.jetDeVie(); actor.jetDeVie();