Skip to content

Commit

Permalink
added additional barrier check to ensure that profile count for AI te…
Browse files Browse the repository at this point in the history
…ams stays at 100
  • Loading branch information
CalebRose committed Oct 11, 2024
1 parent a7b4541 commit 776f0cd
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions managers/TransferPortalManager.go
Original file line number Diff line number Diff line change
Expand Up @@ -694,6 +694,7 @@ func AICoachFillBoardsPhase() {
teamMap := GetCollegeTeamMap()
standingsMap := GetCollegeStandingsMap(seasonID)
profiles := []structs.TransferPortalProfile{}

for idx, teamProfile := range AITeams {
if teamProfile.IsUserTeam {
continue
Expand Down Expand Up @@ -725,8 +726,12 @@ func AICoachFillBoardsPhase() {
majorNeedsMap[r.Position] = false
}
}
profileCount := len(portalProfileMap)

for _, tp := range transferPortalPlayers {
if profileCount >= 100 {
break
}
isBadFit := IsBadSchemeFit(teamProfile.OffensiveScheme, teamProfile.DefensiveScheme, tp.Archetype, tp.Position)
if isBadFit || !majorNeedsMap[tp.Position] || tp.PreviousTeamID == team.ID || portalProfileMap[tp.ID].CollegePlayerID == tp.ID || portalProfileMap[tp.ID].ID > 0 {
continue
Expand Down Expand Up @@ -779,6 +784,7 @@ func AICoachFillBoardsPhase() {

diceRoll := util.GenerateIntFromRange(1, 50)
if diceRoll < biasMod {
profileCount++
portalProfile := structs.TransferPortalProfile{
ProfileID: teamProfile.ID,
CollegePlayerID: tp.ID,
Expand Down

0 comments on commit 776f0cd

Please sign in to comment.