jopeek / fvtt-loot-sheet-npc-5e

FVTT - Loot Sheet NPC 5E
MIT License
44 stars 85 forks source link

this._generateCurrency is not a function #328

Closed ravingdragoon closed 2 years ago

ravingdragoon commented 2 years ago

Describe the bug Loot seeding fails when using a filter ruleset. I am trying to set up a ruleset filter but I keep getting the error below.

To Reproduce Steps to reproduce the behavior:

  1. Create a ruleset with a filter of data.attributes.cr <= 1/2 and then save the changes
  2. Drop a world actor with a CR of 1/2 or lower onto the canvas
  3. See error

Expected behavior The loot generator should properly generate loot.

Screenshots image

LootProcessor.js:342 
Uncaught (in promise) TypeError: this._generateCurrency is not a function
[Detected 1 package: lootsheetnpc5e]
    at LootProcessor._processTextAsCurrency (LootProcessor.js:342:42)
    at LootProcessor._parseTextResults (LootProcessor.js:180:37)
    at LootProcessor._parseResult (LootProcessor.js:156:40)
    at LootProcessor.buildResults (LootProcessor.js:44:46)
    at async Function.addLootToTarget (ActorHelper.js:171:17)
    at async Function.seedItemsToActors (LootSeeder.js:36:109)
    at async onCreateToken (LootsheetNPC5eHooks.js:142:43)
_processTextAsCurrency  @   LootProcessor.js:342
_parseTextResults   @   LootProcessor.js:180
_parseResult    @   LootProcessor.js:156
buildResults    @   LootProcessor.js:44
await in buildResults (async)       
_call   @   foundry.js:294
callAll @   foundry.js:253
callback    @   foundry.js:10095
(anonymous) @   foundry.js:10065
_handleCreateEmbeddedDocuments  @   foundry.js:10065
_createEmbeddedDocuments    @   foundry.js:9957
await in _createEmbeddedDocuments (async)       
create  @   backend.mjs:95
await in create (async)     
createDocuments @   document.mjs:338
create  @   document.mjs:439
_onDropActorData    @   foundry.js:31452
await in _onDropActorData (async)       
_onDrop @   foundry.js:21029
callback    @   foundry.js:44455
_handleDrop @   foundry.js:44506

Desktop (please complete the following information):

Active modules image

DanielBoettner commented 2 years ago

Thanks for the report, will fix this in the near future.