From f6be2d14d6b20884d79036cc5234de24f6c4880c Mon Sep 17 00:00:00 2001 From: Luke Meyers Date: Wed, 5 Feb 2020 17:52:20 -0800 Subject: [PATCH] Fix handoff --- game.go | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/game.go b/game.go index 564475f..15f6f3b 100644 --- a/game.go +++ b/game.go @@ -42,10 +42,10 @@ type baton struct { func updateState(sOld state) state { s := sOld - for _, t := range s.teams { + for i, t := range s.teams { b := t.baton.holder b.pos++ - maybePassBaton(t) + maybePassBaton(&s.teams[i]) } for _, t := range s.teams { @@ -57,7 +57,7 @@ func updateState(sOld state) state { return s } -func maybePassBaton(t team) { +func maybePassBaton(t *team) { for i, b := range t.bots { h := t.baton.holder if h == &b {