get multibots working
This commit is contained in:
+3
-3
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user