League-of-Foundry-Developers / pf2edragruler

2 stars 15 forks source link

Adding support for loot actors and hazard actors #37

Closed cdharma3 closed 1 year ago

cdharma3 commented 1 year ago

I noticed that there was an odd exception being thrown when having pf2edragruler and dragging a pf2e loot actor: https://user-images.githubusercontent.com/42819852/210473881-e09dd6d5-f4e8-460d-8294-38cad0724fc0.mp4

I tracked it down to the movementSpeed function, seems like certain token types in the pf2e system have undefined speeds, specifically both the loot and hazard actors.

I refactored the movementSpeed function slightly to just return a speed = 0 if the actor is a loot or hazard, and changed the if statement somewhat as well.

Notably this does mean that when moving a loot or hazard actor the ruler will always be red, but that's probably fine for the purposes of this.

cdharma3 commented 1 year ago

I noticed as well that the offending line seems to be the findSpeed declaration, the find function call is throwing an error. Rather than the edit I propose above it might be less intrusive to just fix that variable dec, but I'm pretty new to Foundry dev so I'm not entirely certain how that could be done.

velara commented 1 year ago

Release won't be until tomorrow when I've had a chance to bug test things but I've pushed a fix to the main branch that resolves the issue by correcting just the find findSpeed declaration. Thanks for the report, I really appreciate the Pull Request as well.