display mates with more than 2 games
don't count unparsed map wins
This commit is contained in:
@@ -297,11 +297,13 @@ func GetMetaStats(dbPlayer *ent.Player, lock *sync.RWMutex, limit int) (*MetaSta
|
||||
tie := pm.MatchResult == 0
|
||||
|
||||
if _, ok := matchSeen[pm.ID]; !ok {
|
||||
mapMatchTotal[pm.Map]++
|
||||
if win {
|
||||
mapWins[pm.Map]++
|
||||
} else if tie {
|
||||
mapTies[pm.Map]++
|
||||
if pm.Map != "" {
|
||||
mapMatchTotal[pm.Map]++
|
||||
if win {
|
||||
mapWins[pm.Map]++
|
||||
} else if tie {
|
||||
mapTies[pm.Map]++
|
||||
}
|
||||
}
|
||||
|
||||
lock.RLock()
|
||||
@@ -350,7 +352,7 @@ func GetMetaStats(dbPlayer *ent.Player, lock *sync.RWMutex, limit int) (*MetaSta
|
||||
mResponse.MostMates = append(mResponse.MostMates, mostRes)
|
||||
}
|
||||
|
||||
if mostRes.Total > 0 && (wins > 0 || ties > 0) {
|
||||
if mostRes.Total > 1 && (wins > 0 || ties > 0) {
|
||||
mateRes.Player = playerRes
|
||||
mateRes.TieRate = float32(ties) / float32(mostRes.Total)
|
||||
mateRes.WinRate = float32(wins) / float32(mostRes.Total)
|
||||
|
Reference in New Issue
Block a user