Made sure the beastform user isn't moved onto other duplicate actors. Fixed scrolling text duplication (#882)

This commit is contained in:
WBHarry 2025-08-13 02:33:20 +02:00 committed by GitHub
parent 9f545477ae
commit 18f3c47635
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -251,13 +251,15 @@ export const adjustRange = (rangeVal, decrease) => {
};
export const updateActorTokens = async (actor, update) => {
await actor.prototypeToken.update(update);
await actor.prototypeToken.update({ ...update });
/* Update the tokens in all scenes belonging to Actor */
for (let token of actor.getDependentTokens()) {
const tokenActor = token.baseActor ?? token.actor;
if (tokenActor?.id === actor.id) {
await token.update(update);
await token.update({
...update
});
}
}
};
@ -370,7 +372,7 @@ export function getScrollTextData(resources, resource, key) {
export function createScrollText(actor, optionsData) {
if (actor && optionsData?.length) {
actor.getDependentTokens().forEach(token => {
actor.getActiveTokens().forEach(token => {
optionsData.forEach(data => {
const { text, ...options } = data;
canvas.interface.createScrollingText(token.getCenterPoint(), data.text, {