Fix functions getting stuck in retry loop when bot is stopped
@@ -1076,7 +1076,6 @@ func (b *OGame) withRetry(fn func() error) error {
for {
if err := fn(); err != nil {
- if err == ErrNotLogged {
// If we manually logged out, do not try to auto re login.
if !b.IsEnabled() {
return ErrBotInactive
@@ -1084,6 +1083,7 @@ func (b *OGame) withRetry(fn func() error) error {
if !b.IsLoggedIn() {
return ErrBotLoggedOut
}
+ if err == ErrNotLogged {
retry(err)
if loginErr := b.wrapLogin(); loginErr != nil {
b.error(loginErr.Error()) // log error
