Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Attack action not working with automatic animations #843

Open
dralois opened this issue Sep 17, 2024 · 0 comments
Open

Attack action not working with automatic animations #843

dralois opened this issue Sep 17, 2024 · 0 comments

Comments

@dralois
Copy link

dralois commented Sep 17, 2024

I tried setting up a trap, which uses an existing token in the scene and the Attack action.
However, the line below seems to break automatic animations, as actor.token is not available down the line if the actor is cloned.

let itemActor = new CONFIG.Actor.documentClass(actorData);

This breaks automatic animations, which needs a source token for many effects.
To fix this issue, the following small change works for me, but I have not tested if this breaks functionality elsewhere:

@@ -4704,1 +4704,1 @@
                            let actorData = actor.toObject();
                            let itemActor = new CONFIG.Actor.documentClass(actorData);
                            //delete itemActor._id;
-                            item = itemActor.items.get(action.data?.attack?.id);
+                            item = actor.items.get(action.data?.attack?.id);

                            if (item) {

With this change automatic animations work for the attack action if Type of action is set to Use.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant