sort the all bots list

This commit is contained in:
Fraser Graham
2013-11-06 21:12:19 -08:00
parent 855b8518b8
commit cd9bb45ddc
2 changed files with 18 additions and 0 deletions
+1
View File
@@ -160,6 +160,7 @@ func (g *game) tick(payload *Boardstate) int {
func (g *game) send_update(payload *Boardstate) {
// Ensure that the robots are always sent in a consistent order
sort.Sort(RobotSorter{Robots: payload.OtherRobots})
sort.Sort(AllRobotSorter{Robots: payload.AllBots})
for p := range g.players {
// Copy the payload but only add the robots in scanner range