Skip to content

Commit

Permalink
Use parseInt on the speed attribute to increase compatibility with ga…
Browse files Browse the repository at this point in the history
…me systems (resolves #60)
  • Loading branch information
manuelVo committed Apr 20, 2021
1 parent 1faeda6 commit 4be6730
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
## In development
### Compatiblilty
- Drag Ruler's Generic Speed Provider is now able to work with game systems that put non-number characters behind the tokens movement speed (like `30ft.`). One example for such a game system is Dungeon Crawl Classics. ([#60](https://github.com/manuelVo/foundryvtt-drag-ruler/issues/60))


## 1.5.2
### Bugfixes
- Drag Ruler no longer prevents tokens that don't have an actor from being moved. ([#58](https://github.com/manuelVo/foundryvtt-drag-ruler/issues/58))
Expand Down
2 changes: 1 addition & 1 deletion src/speed_provider.js
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ export class GenericSpeedProvider extends SpeedProvider {
const speedAttribute = this.getSetting("speedAttribute")
if (!speedAttribute)
return []
const tokenSpeed = getProperty(token, speedAttribute)
const tokenSpeed = parseInt(getProperty(token, speedAttribute));
if (tokenSpeed === undefined) {
console.warn(`Drag Ruler (Generic Speed Provider) | The configured token speed attribute "${speedAttribute}" didn't return a speed value. To use colors based on drag distance set the setting to the correct value (or clear the box to disable this feature).`)
return []
Expand Down

0 comments on commit 4be6730

Please sign in to comment.