get multibots working

This commit is contained in:
Fraser Graham
2013-11-08 22:26:56 -08:00
parent e39a97089e
commit 570d8eea8e
5 changed files with 104 additions and 106 deletions
+3 -3
View File
@@ -192,7 +192,7 @@ func addPlayer(ws *websocket.Conn) {
}
p := &player{
Robots: []Robot{},
Robots: []*Robot{},
send: make(chan *Boardstate),
ws: ws,
}
@@ -200,14 +200,14 @@ func addPlayer(ws *websocket.Conn) {
for _, stats := range conf.Stats {
r := Robot{
Stats: DeriveStats(stats),
Id: player_id,
Id: idg.Hash(),
Name: clientid.Name,
Health: 10,
Scanners: make([]Scanner, 0)}
r.Health = r.Stats.Hp
log.Printf("Adding Robot: %v", r)
p.Robots = append(p.Robots, r)
r.reset(game)
p.Robots = append(p.Robots, &r)
}
game.register <- p