From b7c9d6e6f1a2bfcca0bda025d5d46ac1f02b82cc Mon Sep 17 00:00:00 2001 From: Frederico Santos Date: Wed, 6 Nov 2024 00:29:47 +0000 Subject: [PATCH] fix: Update party member species handling to support float64 and improve logging --- api/savedata/update.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/api/savedata/update.go b/api/savedata/update.go index 12c1860..efd1785 100644 --- a/api/savedata/update.go +++ b/api/savedata/update.go @@ -95,15 +95,16 @@ func ProcessSessionMetrics(save defs.SessionSaveData, username string) { } formIndex := "" - if formIdx, ok := partyMember["formIndex"].(int); ok && formIdx != 0 { - formIndex = fmt.Sprintf("%d", formIdx) + if formIdx, ok := partyMember["formIndex"].(float64); ok && formIdx != 0 { + formIndex = fmt.Sprintf("%d", int(formIdx)) } - species, ok := partyMember["species"].(int) + speciesFloat, ok := partyMember["species"].(float64) if !ok { log.Printf("invalid type for Species at index %d", i) continue } + species := int(speciesFloat) key := fmt.Sprintf("%d-%s", species, formIndex) party += key + ","