diff --git a/common/user.go b/common/user.go index 1e80ceb9..07eb73c1 100644 --- a/common/user.go +++ b/common/user.go @@ -769,18 +769,16 @@ type GuestAvatar struct { func buildNoavatar(uid, width int) string { if !Config.DisableNoavatarRange { // TODO: Find a faster algorithm - if uid > 50000 { - uid -= 50000 - } - if uid > 5000 { - uid -= 5000 - } - if uid > 500 { - uid -= 500 - } - for uid > 50 { - uid -= 50 + l := func(max int) { + for uid > max { + uid -= max + } } + l(50000) + l(5000) + l(500) + l(50) + l(10) } if !Config.DisableDefaultNoavatar && uid < 11 { if width == 200 { diff --git a/patcher/main.go b/patcher/main.go index 1a38819f..c10541ac 100644 --- a/patcher/main.go +++ b/patcher/main.go @@ -27,8 +27,7 @@ func main() { // Capture panics instead of closing the window at a superhuman speed before the user can read the message on Windows defer func() { - r := recover() - if r != nil { + if r := recover() r != nil { fmt.Println(r) debug.PrintStack() pressAnyKey(scanner) diff --git a/public/n5-200.png b/public/n5-200.png index 09479503..1c0d3cd8 100644 Binary files a/public/n5-200.png and b/public/n5-200.png differ diff --git a/public/n5-48.png b/public/n5-48.png index 8bbc97c7..47b551ab 100644 Binary files a/public/n5-48.png and b/public/n5-48.png differ