Skip to content

Commit

Permalink
Merge pull request #14 from AlexPresso/add_shiny_level
Browse files Browse the repository at this point in the history
Add shinyLevel
  • Loading branch information
AlexPresso authored Jul 14, 2024
2 parents 715fcf3 + e67ba2b commit d75be58
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
1 change: 1 addition & 0 deletions structures/Config.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,5 +9,6 @@ type Config struct {
CraftValue int `json:"craftValue" zu:"display=Valeur de craft"`
IsGolden bool `json:"isGolden" zu:"display=Gold"`
Rarity int `json:"rarity" zu:"display=Rareté"`
ShinyLevel int `json:"shinyLevel" zu:"display=Shiny"`
RecycleValue int `json:"recycleValue" zu:"display=Valeur de recyclage"`
}
4 changes: 2 additions & 2 deletions tasks/checkConfigs.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,12 +21,12 @@ func checkConfigs(db *gorm.DB, embeds *[]discord.Embed) {
dbConfigMap := make(map[string]*structures.Config)
for _, config := range dbConfigs {
config := config
dbConfigMap[fmt.Sprintf("%d:%t", config.Rarity, config.IsGolden)] = &config
dbConfigMap[fmt.Sprintf("%d:%d:%t", config.ShinyLevel, config.Rarity, config.IsGolden)] = &config
}

for i := 0; i < len(configs); i++ {
config := &configs[i]
dbConfig := dbConfigMap[fmt.Sprintf("%d:%t", config.Rarity, config.IsGolden)]
dbConfig := dbConfigMap[fmt.Sprintf("%d:%d:%t", config.ShinyLevel, config.Rarity, config.IsGolden)]

if dbConfig != nil {
config.ID = dbConfig.ID
Expand Down

0 comments on commit d75be58

Please sign in to comment.