Skip to content
This repository has been archived by the owner on Nov 13, 2024. It is now read-only.

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
p4535992 committed Feb 11, 2023
1 parent 3204697 commit 78a2887
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/scripts/mountManager.ts
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ export class MountManager {
return;
}
if (!(String(mountToken.actor?.getFlag(CONSTANTS.MODULE_NAME, MountUpFlags.IsAMount)) === "true")) {
warn(i18nFormat(`${CONSTANTS.MODULE_NAME}.isNotAMount`,{mount: hudToken.name}), true);
warn(i18nFormat(`${CONSTANTS.MODULE_NAME}.isNotAMount`, { mount: hudToken.name }), true);
return;
}
const tokensToCheck = canvas.tokens?.controlled || [];
Expand Down Expand Up @@ -170,10 +170,12 @@ export class MountManager {
dismountDropTargetTA(mountToken, riderToken);

// Chatter.dismountMessage(riderToken.id, mountToken.id);
const riders = <string[]>mountToken.actor?.getFlag(CONSTANTS.MODULE_NAME, MountUpFlags.Riders);
const riders = <string[]>mountToken.actor?.getFlag(CONSTANTS.MODULE_NAME, MountUpFlags.Riders) ?? [];
await mountToken.actor?.unsetFlag(CONSTANTS.MODULE_NAME, MountUpFlags.Riders);

riders.splice(riders.indexOf(riderToken.id));
// https://github.com/p4535992/foundryvtt-mountup/issues/19
if (riders.length > 0) {
riders.splice(riders.indexOf(riderToken.id), 1);
}
await mountToken.actor?.setFlag(CONSTANTS.MODULE_NAME, MountUpFlags.Riders, riders);
await riderToken.actor?.unsetFlag(CONSTANTS.MODULE_NAME, MountUpFlags.Mount);
await riderToken.actor?.unsetFlag(CONSTANTS.MODULE_NAME, MountUpFlags.OrigSize);
Expand Down

0 comments on commit 78a2887

Please sign in to comment.