From fd02a12ae9783be85a97aef8776215266a73c0fa Mon Sep 17 00:00:00 2001 From: wish Date: Sun, 31 Dec 2023 10:22:27 +1100 Subject: [PATCH] add DefaultCourses DevModeOption --- common/mhfcourse/mhfcourse.go | 6 +++++- config.json | 1 + config/config.go | 1 + 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/common/mhfcourse/mhfcourse.go b/common/mhfcourse/mhfcourse.go index f838e64a5..272d3e3d4 100644 --- a/common/mhfcourse/mhfcourse.go +++ b/common/mhfcourse/mhfcourse.go @@ -1,6 +1,7 @@ package mhfcourse import ( + _config "erupe-ce/config" "math" "sort" "time" @@ -66,7 +67,10 @@ func CourseExists(ID uint16, c []Course) bool { // GetCourseStruct returns a slice of Course(s) from a rights integer func GetCourseStruct(rights uint32) ([]Course, uint32) { - resp := []Course{{ID: 1}, {ID: 23}, {ID: 24}} + var resp []Course + for _, c := range _config.ErupeConfig.DevModeOptions.DefaultCourses { + resp = append(resp, Course{ID: c}) + } s := Courses() sort.Slice(s, func(i, j int) bool { return s[i].ID > s[j].ID diff --git a/config.json b/config.json index 1d5fe76d7..a099936bc 100644 --- a/config.json +++ b/config.json @@ -29,6 +29,7 @@ "TournamentEvent": 0, "DisableTokenCheck": false, "QuestDebugTools": false, + "DefaultCourses": [1, 23, 24], "EarthStatusOverride": 0, "EarthIDOverride": 0, "EarthMonsterOverride": [0, 0, 0, 0], diff --git a/config/config.go b/config/config.go index 4995c042d..7e87fd8b8 100644 --- a/config/config.go +++ b/config/config.go @@ -110,6 +110,7 @@ type DevModeOptions struct { TournamentEvent int // VS Tournament event status DisableTokenCheck bool // Disables checking login token exists in the DB (security risk!) QuestDebugTools bool // Enable various quest debug logs + DefaultCourses []uint16 EarthStatusOverride int32 EarthIDOverride int32 EarthMonsterOverride []int32