KayelGee / token-attacher

MIT License
11 stars 18 forks source link

Placing a prefabricate breaks on linking attached elements #74

Closed jonathanmclaus closed 1 year ago

jonathanmclaus commented 2 years ago

When I drop an actor / token down that has attached elements, the attached elements are replicated for the new placement but not linked properly. They aren't attached to the new token and can't be linked afterwards it seems.

The error when placing a token for a prefab:

token-attacher.js:1938 Uncaught (in promise) TypeError: Cannot read properties of undefined (reading 'type')
[Detected 1 package: token-attacher]
    at Function.regenerateLinks (token-attacher.js:1938)
    at Function.batchPostProcess (token-attacher.js:2016)
    at token-attacher.js:239
    at Function._call (foundry.js:294)
    at Function.callAll (foundry.js:253)
    at Function.regenerateAttachedFromPrototype (token-attacher.js:1869)
    at async Function.updateAttachedCreatedToken (token-attacher.js:1794)
regenerateLinks @ token-attacher.js:1938
batchPostProcess @ token-attacher.js:2016
(anonymous) @ token-attacher.js:239
_call @ foundry.js:294
callAll @ foundry.js:253
regenerateAttachedFromPrototype @ token-attacher.js:1869
async function (async)
batchPostProcess @ token-attacher.js:2016
(anonymous) @ token-attacher.js:239
_call @ foundry.js:294
callAll @ foundry.js:253
regenerateAttachedFromPrototype @ token-attacher.js:1869
async function (async)
regenerateAttachedFromPrototype @ token-attacher.js:1810
updateAttachedCreatedToken @ token-attacher.js:1794
(anonymous) @ token-attacher.js:235
_call @ foundry.js:294
callAll @ foundry.js:253
callback @ foundry.js:10095
(anonymous) @ foundry.js:10065
_handleCreateEmbeddedDocuments @ foundry.js:10065
_createEmbeddedDocuments @ foundry.js:9957
async function (async)
_createEmbeddedDocuments @ foundry.js:9946
create @ backend.mjs:95
async function (async)
create @ backend.mjs:93
createDocuments @ document.mjs:338
create @ document.mjs:439
_onDropActorData @ foundry.js:31452
async function (async)
_onDropActorData @ foundry.js:31421
_onDrop @ foundry.js:21029
callback @ foundry.js:44455
_handleDrop @ foundry.js:44506
KayelGee commented 2 years ago

I'll need more infos here. What system are you using? Do you have other modules active? Where did this prefab come from? If you created it yourself, can you right click the actor and export data and upload it here?