mirror of
https://github.com/pagefaultgames/rogueserver.git
synced 2025-03-31 02:02:54 +08:00
fix: Update party member species handling to support float64 and improve logging
This commit is contained in:
parent
400cb28ee3
commit
b7c9d6e6f1
@ -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 + ","
|
||||
|
Loading…
x
Reference in New Issue
Block a user