Skip to content

Commit

Permalink
fix(dnd5e): 修复先攻相同时,查看会乱序的问题 (sealdice#166)
Browse files Browse the repository at this point in the history
  • Loading branch information
JustAnotherID authored Aug 24, 2023
1 parent 116d9a7 commit 057e06e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion dice/ext_dnd5e.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,14 @@ package dice
import (
"encoding/json"
"fmt"
"gopkg.in/yaml.v3"
"math"
"os"
"regexp"
"sort"
"strconv"
"strings"

"gopkg.in/yaml.v3"
)

type RIListItem struct {
Expand All @@ -27,6 +28,9 @@ func (lst ByRIListValue) Swap(i, j int) {
lst[i], lst[j] = lst[j], lst[i]
}
func (lst ByRIListValue) Less(i, j int) bool {
if lst[i].val == lst[j].val {
return lst[i].name > lst[j].name
}
return lst[i].val > lst[j].val
}

Expand Down

0 comments on commit 057e06e

Please sign in to comment.