diff --git a/internal/modlist/modlist.go b/internal/modlist/modlist.go index ed67e6e..08043b3 100644 --- a/internal/modlist/modlist.go +++ b/internal/modlist/modlist.go @@ -29,17 +29,19 @@ type Modlist struct { func (modlist *Modlist) setModStatus(name string, status bool) { for i := range modlist.Mods { - if modlist.Mods[i].Name == name && modlist.Mods[i].Enabled != status { - modlist.Mods[i].Enabled = status - log.Debugf("Setting status of mod %s to %v", modlist.Mods[i].Name, modlist.Mods[i].Enabled) + mod := &modlist.Mods[i] + if mod.Name == name && mod.Enabled != status { + mod.Enabled = status + log.Debugf("Setting status of mod %s to %v", mod.Name, mod.Enabled) } } } func (modlist *Modlist) setAllStatus(status bool) { for i := range modlist.Mods { - modlist.Mods[i].Enabled = status - log.Debugf("Setting status of mod %s to %v", modlist.Mods[i].Name, modlist.Mods[i].Enabled) + mod := &modlist.Mods[i] + mod.Enabled = status + log.Debugf("Setting status of mod %s to %v", mod.Name, mod.Enabled) } }