dice-roller / rpg-dice-roller

An advanced JS based dice roller that can roll various types of dice and modifiers, along with mathematical equations.
https://dice-roller.github.io/documentation
MIT License
243 stars 58 forks source link

Can't seem to combine drop/keep and sort #143

Closed deurk closed 4 years ago

deurk commented 4 years ago

Description It seems that any attempt at sorting a dice roll with drop/keep option is just ignoring the specified drop/keep parameters.

Example Rolling 4d6d1sd gives something like [5, 4, 3, 2] = 14.

Expected result Since drop/keep operation is lower on the order list of operations, the result should be [5, 4, 3, 2d] = 12.

GreenImp commented 4 years ago

You're right! It seems to affect other modifiers as well;

This isn't exploding:

4d6!sd: [6, 4, 1, 1] = 12

That's an odd one. I'll have a look into it.

GreenImp commented 4 years ago

@deurk what version of the dice roller are you using? I can reproduce it on the roll components in the documentation https://greenimp.github.io/rpg-dice-roller/#try-me but I'm having difficulty reproducing it locally.

GreenImp commented 4 years ago

Are you using an obfuscated/mangled version of the code? I've found an issue in these cases where it's relying on the modifier's class name for unique checks, but the class names are changed to a single letter, and are sometimes the same letter as other modifiers.

I'm going to get a fix in for that, but can you verify whether you're running an obfuscated version of the code or not?

deurk commented 4 years ago

Nope, was just using the in-site roller, I was testing it to see if I could integrate it to some tools I run.

GreenImp commented 4 years ago

Do you mean the roller on the documentation? If so, I've fixed that in v4.1.2, which I'll be pushing up to the docs later today.

It was an issue with how the code was obfuscated.

deurk commented 4 years ago

Perfect, thanks a lot.

deurk commented 4 years ago

Let me know when you pushed to the docs :)

GreenImp commented 4 years ago

Right, they're updated now! Sorry it took a bit longer than I'd have liked as I found an issue with a cyclical dependency - the docs were in the same repo as the dice roller, but also included the dice roller (For the roll components), so when the docs were published, they were always out of date. I've had to split the docs into a separate repo, but still pointing to the same place.

It should all be updated and working now: https://greenimp.github.io/rpg-dice-roller/

deurk commented 4 years ago

Works like a charm, thank you !

deurk commented 4 years ago

Little regression ? Seems like doc is back to not dropping while sorted :)

GreenImp commented 4 years ago

Ah, sorry. Looks like the master branch on this repo was rebuilt in Travis and it overwrote the docs again. The changes to remove the docs from here are still on the develop branch. Might push them to master today, to stop this happening again.

I've re-run the build from the docs repo, and it should be working now. You may need to clear your browser cache though.