edzillion / blood-n-guts

Other
4 stars 16 forks source link

Wiping all token flags leaves 1 flag on a random token on the canvas. #153

Closed edzillion closed 3 years ago

edzillion commented 3 years ago

Getting some weird issues trying to unset flags. If I try to wipe flags on all tokens on the scene and then reload, there is usually 1 token that still has 1 flag on it. Seems like an async issue, but I can't see what I am doing wrong.

    for (const tokenId in BloodNGuts.splatTokens) promises.push(BloodNGuts.splatTokens[tokenId].wipeFlags());
    await Promise.all(promises);
  public async wipeFlags(): Promise<PlaceableObject> {
    this.wipeSplats();
    this.tokenSplats = [];
    if (this.token) return this.token.setFlag(MODULE_ID, 'splats', null);
  }
edzillion commented 3 years ago

Fixed in #162