fix: statuses are Set not Array, change include() to has() in placeables/token.mjs (#451)

It crash if I have a status on a token and I refresh Foundry.
It's because it calls a include() function on a Set.
This commit is contained in:
Cyril ALFARO 2025-07-29 13:00:48 +02:00 committed by GitHub
parent 4defe69c21
commit 253faabbcf
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -18,7 +18,7 @@ export default class DhTokenPlaceable extends foundry.canvas.placeables.Token {
x => x.statuses.size === 1 && x.name === game.i18n.localize(statusMap.get(x.statuses.first()).name)
);
for (var status of effect.statuses) {
if (!currentStatusActiveEffects.find(x => x.statuses.includes(status))) {
if (!currentStatusActiveEffects.find(x => x.statuses.has(status))) {
const statusData = statusMap.get(status);
acc.push({
name: game.i18n.localize(statusData.name),