sync: Allow free hint

This commit is contained in:
nemunaire 2021-11-14 16:15:19 +01:00
parent 43be59b97d
commit 57d351c6c1
2 changed files with 3 additions and 3 deletions

View File

@ -12,7 +12,7 @@ import (
type ExerciceHintParams struct {
Filename string
Content string
Cost int64
Cost *int64
Title string
NeedFlag []ExerciceDependency `toml:"need_flag,omitempty"`
}

View File

@ -36,10 +36,10 @@ func buildExerciceHints(i Importer, exercice fic.Exercice) (hints []importHint,
} else {
h.Title = fixnbsp(hint.Title)
}
if hint.Cost <= 0 {
if hint.Cost == nil {
h.Cost = exercice.Gain / 4
} else {
h.Cost = hint.Cost
h.Cost = *hint.Cost
}
if hint.Filename != "" {