HadaIonut / Foundry-mgl

The ultimate tool for playing dnd5e using the metric system
MIT License
2 stars 7 forks source link

Does not work on some actors #22

Open HenriDeh opened 2 years ago

HenriDeh commented 2 years ago

Hi,

I'm trying to use this module to convert my creature actors to meters. The Metrificator does not work on all actors. I could not find a common point between those on which it works and those on which it doesn't. What I can tell you is that if it does not work on the token sheet, it does not work on the actor folder sheet either and the metrify all actors buttons won't convert these actors.

For example I can convert -Zombie -Ogre Skeleton -Skeleton I can't convert -Ash Zombie -Ogre Zombie -Skeletal Warhorse

There is no error message and the issue persists with all modules (but this one) deactivated.
I don't know if this is related but the console displays this deprecation warning when using the Metrificator button on an actor that is not metrified:

actor updated! @ foundry.js:3272 
You are referencing DocumentSheet#entity which has been deprecated in favor of DocumentSheet#document
  |get entity | @ | foundry.js:3272
  | _onRenderActorSheet | @ | concentrator.js:250
  | (anonymous) | @ | signal.js:191
  | _call | @ | VM25899:4
  | call | @ | foundry.js:179
  | _render | @ | foundry.js:2104
  | async function (async) |   |  
  | _render | @ | foundry.js:2049
  | 🎁call_wrapped | @ | libWrapper-wrapper.js:466
  | 🎁Application.prototype._render#lib-wrapper | @ | listeners.js:110
  | 🎁Application.prototype._render#0 | @ | libWrapper-wrapper.js:161
  | _render | @ | foundry.js:2736
  | render | @ | foundry.js:2011
  | render | @ | foundry.js:3231
  | render | @ | foundry.js:9461
  | _onUpdate | @ | foundry.js:9515
  | _onUpdate | @ | foundry.js:12482
  | _onUpdate | @ | entity.js:1915
  | _onUpdateTokenActor | @ | foundry.js:16917
  | 🎁call_wrapped | @ | libWrapper-wrapper.js:466
  | 🎁TokenDocument.prototype._onUpdateTokenActor#plutonium | @ | PatcherToken.js:33
  | 🎁call_wrapper | @ | libWrapper-wrapper.js:575
  | 🎁TokenDocument.prototype._onUpdateTokenActor#0 | @ | libWrapper-wrapper.js:163
  | _onUpdate | @ | foundry.js:16803
  | callback | @ | foundry.js:8963
  | (anonymous) | @ | foundry.js:8946
  | _handleUpdateEmbeddedDocuments | @ | foundry.js:8946
  | _updateEmbeddedDocuments | @ | foundry.js:8835
  | async function (async) |   |  
  | _updateEmbeddedDocuments | @ | foundry.js:8824
  | 🎁call_wrapped | @ | libWrapper-wrapper.js:466
  | 🎁ClientDatabaseBackend.prototype._updateEmbeddedDocuments#TokensVisible | @ | TokensVisible.js:483
  | 🎁call_wrapper | @ | libWrapper-wrapper.js:575
  | 🎁ClientDatabaseBackend.prototype._updateEmbeddedDocuments#0 | @ | libWrapper-wrapper.js:163
  | update | @ | backend.mjs:153
  | async function (async) |   |  
  | update | @ | backend.mjs:151
  | updateDocuments | @ | document.mjs:366
  | update | @ | document.mjs:448
  | modifyActorDocument | @ | foundry.js:16604
  | _updateEmbeddedDocuments | @ | foundry.js:8813
  | 🎁call_wrapped | @ | libWrapper-wrapper.js:466
  | 🎁ClientDatabaseBackend.prototype._updateEmbeddedDocuments#TokensVisible | @ | TokensVisible.js:483
  | 🎁call_wrapper | @ | libWrapper-wrapper.js:575
  | 🎁ClientDatabaseBackend.prototype._updateEmbeddedDocuments#0 | @ | libWrapper-wrapper.js:163
  | update | @ | backend.mjs:153
  | async function (async) |   |  
  | update | @ | backend.mjs:151
  | updateDocuments | @ | document.mjs:366
  | update | @ | document.mjs:448
  | actorUpdater | @ | Dnd5eConverterNew.js:48
  | (anonymous) | @ | MetricModule.js:81
  | dispatch | @ | jquery.min.js:2
  | v.handle | @ | jquery.min.js:2

This warning also appears on actors where the convert does work, but it appears several times (once for each conversion I guess), whereas it appears only once when conversion fails (though there is no error thrown).

That's all information I have, please do not hesitate to ask me for more information if you need.

And thanks for this useful module.

SirMotte commented 2 years ago

I can confirm that in some instances this happens with miles as well. E.g. the SRD Alarm Spell, where all entries are translated but for the 1 mile in the description

grafik