mirror of
https://github.com/Mezeporta/Erupe.git
synced 2025-12-14 16:04:38 +01:00
split into questSuffix function
This commit is contained in:
@@ -61,7 +61,7 @@ func handleMsgSysGetFile(s *Session, p mhfpacket.MHFPacket) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
func seasonConversion(s *Session, questFile string) string {
|
func questSuffix(s *Session) string {
|
||||||
// Determine the letter to append for day / night
|
// Determine the letter to append for day / night
|
||||||
var timeSet string
|
var timeSet string
|
||||||
if TimeGameAbsolute() > 2880 {
|
if TimeGameAbsolute() > 2880 {
|
||||||
@@ -69,8 +69,11 @@ func seasonConversion(s *Session, questFile string) string {
|
|||||||
} else {
|
} else {
|
||||||
timeSet = "n"
|
timeSet = "n"
|
||||||
}
|
}
|
||||||
|
return fmt.Sprintf("%s%d", timeSet, s.server.Season())
|
||||||
|
}
|
||||||
|
|
||||||
filename := fmt.Sprintf("%s%s%d", questFile[:5], timeSet, s.server.Season())
|
func seasonConversion(s *Session, questFile string) string {
|
||||||
|
filename := fmt.Sprintf("%s%s", questFile[:5], questSuffix(s))
|
||||||
|
|
||||||
// Return original file if file doesn't exist
|
// Return original file if file doesn't exist
|
||||||
if _, err := os.Stat(filename); err == nil {
|
if _, err := os.Stat(filename); err == nil {
|
||||||
|
|||||||
Reference in New Issue
Block a user