Disabling levels filter for commanders
This commit is contained in:
parent
ce553aea58
commit
7b144a42af
@ -167,12 +167,16 @@ func (s *Squader) AddUserToSquad(update *tgbotapi.Update, adderRaw *dbmapping.Pl
|
|||||||
if !c.Users.PlayerBetterThan(playerRaw, "admin") {
|
if !c.Users.PlayerBetterThan(playerRaw, "admin") {
|
||||||
if playerRaw.LeagueID != 1 {
|
if playerRaw.LeagueID != 1 {
|
||||||
return s.squadUserAdditionFailure(update)
|
return s.squadUserAdditionFailure(update)
|
||||||
} else if squadRaw.Squad.MinLevel > profileRaw.LevelID {
|
} else if userType != "commander" {
|
||||||
|
if squadRaw.Squad.MinLevel > profileRaw.LevelID {
|
||||||
|
c.Log.Debug("Levels mismatch: min"+strconv.Itoa(squadRaw.Squad.MinLevel), ", player: "+strconv.Itoa(profileRaw.LevelID))
|
||||||
return s.squadUserAdditionFailure(update)
|
return s.squadUserAdditionFailure(update)
|
||||||
} else if squadRaw.Squad.MaxLevel-1 < profileRaw.LevelID {
|
} else if squadRaw.Squad.MaxLevel-1 < profileRaw.LevelID {
|
||||||
|
c.Log.Debug("Levels mismatch: max"+strconv.Itoa(squadRaw.Squad.MaxLevel), ", player: "+strconv.Itoa(profileRaw.LevelID))
|
||||||
return s.squadUserAdditionFailure(update)
|
return s.squadUserAdditionFailure(update)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// All checks are passed here, creating new item in database
|
// All checks are passed here, creating new item in database
|
||||||
playerSquad := dbmapping.SquadPlayer{}
|
playerSquad := dbmapping.SquadPlayer{}
|
||||||
|
Reference in New Issue
Block a user