Skip to content

Commit 4ef1a5a

Browse files
committed
remove has_options
1 parent e4c692b commit 4ef1a5a

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

cheat-parser.go

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,9 @@ import (
1414
)
1515

1616
type Cheat struct {
17-
Note string `json:"note"`
18-
Data []string `json:"data"`
19-
Options map[string]string `json:"options"`
20-
HasOptions bool `json:"hasOptions"`
17+
Note string `json:"note"`
18+
Data []string `json:"data"`
19+
Options map[string]string `json:"options"`
2120
}
2221

2322
func main() {
@@ -63,12 +62,11 @@ func main() {
6362
game[currentCheat] = cheat
6463
} else if scanner.Text() == "" {
6564
// do nothing
66-
} else if strings.Contains(scanner.Text(), "?") && !cheat.HasOptions {
67-
cheat.HasOptions = true
65+
} else if strings.Contains(scanner.Text(), "?") && cheat.Options == nil {
6866
cheat.Options = map[string]string{}
6967
cheat.Data = append(cheat.Data, scanner.Text())
7068
game[currentCheat] = cheat
71-
} else if cheat.HasOptions && len(strings.Split(scanner.Text(), " ")[0]) < 8 {
69+
} else if cheat.Options != nil && len(strings.Split(scanner.Text(), " ")[0]) < 8 {
7270
cheat.Options[strings.Join(strings.Split(scanner.Text(), " ")[1:], " ")] = strings.Split(scanner.Text(), " ")[0]
7371
game[currentCheat] = cheat
7472
} else {

cheats.json

Lines changed: 1 addition & 1 deletion
Large diffs are not rendered by default.

0 commit comments

Comments
 (0)