get multibots working
This commit is contained in:
@@ -117,7 +117,7 @@ func (g *game) tick(payload *Boardstate) int {
|
||||
for _, r := range p.Robots {
|
||||
if r.Health > 0 {
|
||||
living_robots++
|
||||
p.Tick(g)
|
||||
r.Tick(g)
|
||||
}
|
||||
|
||||
if len(r.Message) > 0 {
|
||||
@@ -180,7 +180,7 @@ func (g *game) send_update(payload *Boardstate) {
|
||||
player_payload.Turn = payload.Turn
|
||||
player_payload.Reset = payload.Reset
|
||||
for _, r := range p.Robots {
|
||||
player_payload.MyRobots = append(player_payload.MyRobots, r)
|
||||
player_payload.MyRobots = append(player_payload.MyRobots, *r)
|
||||
player_payload.OtherRobots = append(
|
||||
player_payload.OtherRobots,
|
||||
r.GetTruncatedDetails())
|
||||
@@ -209,7 +209,7 @@ func (g *game) send_update(payload *Boardstate) {
|
||||
// Filter projectiles
|
||||
for proj := range g.projectiles {
|
||||
|
||||
if proj.Owner == &r {
|
||||
if proj.Owner == r {
|
||||
player_payload.Projectiles = append(
|
||||
player_payload.Projectiles,
|
||||
*proj)
|
||||
|
||||
Reference in New Issue
Block a user