p4535992 / foundryvtt-automated-polymorpher

GNU General Public License v3.0
2 stars 8 forks source link

Note on commented Revert failure #10

Open trioderegion opened 2 years ago

trioderegion commented 2 years ago

https://github.com/p4535992/foundryvtt-automated-polymorpher/blob/f5ea5bfe5e3d74c8a61344ce35941ede5cf8536c/src/module/api.ts#L129

This revert is not working due to this line used for the mutation: https://github.com/p4535992/foundryvtt-automated-polymorpher/blob/f5ea5bfe5e3d74c8a61344ce35941ede5cf8536c/src/module/polymorphermanager.ts#L750

where tokenFromTransform is defined as: https://github.com/p4535992/foundryvtt-automated-polymorpher/blob/f5ea5bfe5e3d74c8a61344ce35941ede5cf8536c/src/module/polymorphermanager.ts#L532

This object is a TokenData class, which does not have an actor field, resulting in the ID being used as the mutation name being null, which causes warp gate to generate a random ID as the name of this mutation.

p4535992 commented 2 years ago

Thanks @trioderegion, I knew I was doing something wrong ...

So the simplest solution might be to use the original token id present on tokenData instead of the actor? Or is a static string generated at runtime better?

trioderegion commented 2 years ago

Either approach would work. Since its token specific, you dont have to worry about name collisions much at all. Whatever identifier you have on hand that is relatively specific and easy to generate will work. Heck, it could be just "Automated Polymorph" as the name

p4535992 commented 2 years ago

ty for the support should be solved with 1.0.23

p4535992 commented 2 years ago

@trioderegion i spoke to soon... i must done something wrong again, there is this issue https://github.com/p4535992/foundryvtt-automated-polymorpher/issues/11

i cannot replicate on my side, but it's seem related to the line:

https://github.com/trioderegion/warpgate/blob/a6850958df732837a6c779b8af9e250b2dcfa18c/scripts/mutator.js#L427

Here the code used for the mutation:

https://github.com/p4535992/foundryvtt-automated-polymorpher/blob/ae2fb7c03e65147d41bfb449cf1e2f20b50879ce/src/module/polymorphermanager.ts#L365

is a stupid error of mine on the 'updates' object for make failing the 'toObject ()' function?

trioderegion commented 2 years ago

Hmm, whatever is going on is not immediately apparent to me. I would love to see exactly what is being passed into mutate. The line you pointed out, while not the safest, should be valid (I noticed this as well and filed an issue on warpgate to fix it).

I really should be logging these inputs on my side 😅 .

p4535992 commented 2 years ago

For the resolution of this ticket there is a open commissions on the league discrod server for anyone is feeling generous about it.