Archived
1

Fix for squads relations

This commit is contained in:
Vladimir Hodakov 2018-02-17 17:22:08 +04:00
parent 2617375f46
commit 5fda8af5fa

View File

@ -43,6 +43,8 @@ func (dc *DataCache) loadSquads() {
dc.squads[squads[i].ID] = &squads[i]
dc.squadsWithChats[squads[i].ID] = &squadWithChat
}
dc.squadPlayers[squads[i].ID] = make(map[int]*dbmapping.SquadPlayerFull)
}
for i := range squadsPlayersRelations {
@ -58,10 +60,6 @@ func (dc *DataCache) loadSquads() {
squadPlayer.Squad = *sSquad
squadPlayer.UserRole = squadsPlayersRelations[i].UserType
if dc.squadPlayers[sSquad.Squad.ID] == nil {
dc.squadPlayers[sSquad.Squad.ID] = make(map[int](*dbmapping.SquadPlayerFull))
}
dc.squadPlayers[sSquad.Squad.ID][sPlayer.ID] = &squadPlayer
}
}