Larkinabout / fvtt-token-action-hud-pf2e

Token Action HUD is a repositionable HUD of actions for a selected token.
10 stars 15 forks source link

Comparisons against 5.* system versions provide incorrect results in version 5.10.* #102

Closed Cuingamehtar closed 10 months ago

Cuingamehtar commented 11 months ago

This is evident when displaying strike MAP values. The module thinks that game.system.version < "5.2.0" is true due to string comparison, which I guess isn't very suited for semantic version comparison.

soaringthor commented 11 months ago

I think this can be fixed by defining a new const: systemVersion = coreModule.api.Utils.getModuleVersionParts(game.system.version) and then doing comparisons like if ((this.systemVersion.major < 5) || (this.systemVersion.major == 5 && this.systemVersion.minor < 2)). game.system.version appears in both the RollHandler and ActionHandler so I'm not sure where to best put this const. I'm not a coder so I'm hoping this is an easy enough fix for someone who knows what they're doing!

Cuingamehtar commented 11 months ago

Alternatively, the required PF2e version for this module can be updated so that the check is no longer necessary.

Larkinabout commented 10 months ago

Fixed in 1.5.4.