Corrections relecture IA

This commit is contained in:
2026-03-24 20:45:54 +01:00
parent a768419029
commit d80efba092
9 changed files with 201 additions and 180 deletions
+4 -9
View File
@@ -93,13 +93,8 @@ export class RdDBaseActor extends Actor {
}
static getRealActor(actorId, tokenId) {
if (tokenId) {
let token = canvas.tokens.get(tokenId)
if (token) {
return token.actor
}
}
return game.actors.get(actorId)
const actor = tokenId ? canvas.tokens.get(tokenId)?.actor : undefined
return actor ?? game.actors.get(actorId)
}
getAlias() {
@@ -285,7 +280,7 @@ export class RdDBaseActor extends Actor {
return this.getEffects().filter(it => it.statuses.has(effectId))
}
async setEffect(effectId, status, options = {render: true}) {
async setEffect(effectId, status, options = { render: true }) {
if (this.isEffectAllowed(effectId)) {
const effects = this.getEffectsByStatus(effectId)
if (!status && effects.length > 0) {
@@ -301,7 +296,7 @@ export class RdDBaseActor extends Actor {
this.removeEffects(it => it.id == id)
}
async removeEffects(filter = e => true, options = {render: true}) {
async removeEffects(filter = e => true, options = { render: true }) {
if (game.user.isGM) {
const ids = this.getEffects(filter)
.filter(it => this.canRemoveEffects(it))