SalieriC / SWIM

A collection of macros for the SWADE system on Foundry with a focus on immersion (i.e. by using sound effects)
GNU General Public License v3.0
10 stars 12 forks source link

Travel Calculator crashes when no encounters are loaded #139

Closed mysurvive closed 1 year ago

mysurvive commented 1 year ago

Describe the bug The travel calculator macro crashes when there are no encounters loaded in the settings with the error "cannot read properties of undefined (reading 'checked'). image image

To Reproduce Steps to reproduce the behavior:

  1. Create a new world
  2. Run the travel calculator macro
  3. Macro crashes
  4. image

Expected behavior The macro appears to have optional encounters, so having no encounters loaded seems like a logical, correct, and valid way of running the macro.

Screenshots Several screenshots posted.

Desktop (please complete the following information):

Additional context I already submitted a PR for the fix, I got ahead of myself and didn't see you wanted an issue first.

SalieriC commented 1 year ago

Thank you for your time and effort. =) Did my commit here not fix the issue for you? I cannot reproduce that error with it. Note that the code on git is more recent than the release. I suppose your PR wouldn't hurt, I just wonder if I'm missing something here.

mysurvive commented 1 year ago

That's totally my fault for not pulling from github and instead just opening the latest module release! That looks like it'll work (and is much more elegant than my solution :) ), I can test it this evening and report back.

mysurvive commented 1 year ago

Coming back to report that the fix is working _swim_mingly (forgive me, I had to do it). I'll close the PR!

SalieriC commented 1 year ago

No problem mate, I highly appreciate your time. Please feel free to help improve SWIM further in the future if you like and find something that could be improved. =) Also, you are forgiven for the pun on the name. Both SWIM and SUCC have their abbreviations chosen deliberately to allow for puns anyway. :D