NiceTSY / nice-cypher-add-ons

Small QOL for the Cypher System on FoundryVTT
BSD 3-Clause "New" or "Revised" License
3 stars 4 forks source link

[BUG] Creation doesn't work for second character option #36

Open AfroSpartan opened 2 months ago

AfroSpartan commented 2 months ago

Describe the bug The second time a user drops a character option onto their sheet nothing happens and an error is shown in the console Cannot access 'skill' before initialization

This is the offending line: https://github.com/NiceTSY/nice-cypher-add-ons/blob/5914778da7f7e89aa97345501f3068902716df28/scripts/module_creation.js#L803

To Reproduce Steps to reproduce the behavior:

  1. Create a type and a focus or descriptor, both of them with skills
  2. Drag one with skills onto a sheet
  3. Drag the other onto a sheet
  4. Nothing should happen and error should be shown in the console

Expected behavior Dragging character options onto a sheet should add the relevant items to the sheet

Screenshots I would screen shot it but I think I've fixed it locally

Desktop (please complete the following information):

Additional context I think I've fixed the issue locally. I'm not sure on the intended function of the code I've changed though so I wouldn't be surprised if it's not working as intended.