orffen / basicfantasyrpg

The Basic Fantasy RPG system for FoundryVTT!
Other
11 stars 9 forks source link

createActor hook still references #data object #33

Closed orffen closed 1 year ago

orffen commented 2 years ago

Error: You are accessing the BasicFantasyRPGActor#data object which is no longer used. Since V10 the Document class and its contained DataModel are merged into a combined data structure. You should now reference keys which were previously contained within the data object directly. at logCompatibilityWarning (commons.js:1232) at Function._logV10CompatibilityWarning (commons.js:6119) at BasicFantasyRPGActor.get data [as data] (commons.js:6019) at Object.fn (basicfantasyrpg.mjs:89) at Function.#call (foundry.js:688) at Function.callAll (foundry.js:645) at ClientDatabaseBackend.callback (foundry.js:12461) at foundry.js:12399 at Array.map () at ClientDatabaseBackend._handleCreateDocuments (foundry.js:12399)

orffen commented 2 years ago

actor.data.token.actorLink = true; is triggering the warning, need to find how to access the 'old' actor.data.token - does not appear to be actor.token which is null.

orffen commented 2 years ago

Updated code needs to be something like: actor.prototypeToken.actorLink = true;

orffen commented 2 years ago

I'm having a bit of trouble figuring out why this is no longer working in v10, may need to take a look at how other modules are handling this.