Fix handoff

This commit is contained in:
Luke Meyers 2020-02-05 17:52:20 -08:00
parent 4ee2ed3222
commit f6be2d14d6
1 changed files with 3 additions and 3 deletions

View File

@ -42,10 +42,10 @@ type baton struct {
func updateState(sOld state) state { func updateState(sOld state) state {
s := sOld s := sOld
for _, t := range s.teams { for i, t := range s.teams {
b := t.baton.holder b := t.baton.holder
b.pos++ b.pos++
maybePassBaton(t) maybePassBaton(&s.teams[i])
} }
for _, t := range s.teams { for _, t := range s.teams {
@ -57,7 +57,7 @@ func updateState(sOld state) state {
return s return s
} }
func maybePassBaton(t team) { func maybePassBaton(t *team) {
for i, b := range t.bots { for i, b := range t.bots {
h := t.baton.holder h := t.baton.holder
if h == &b { if h == &b {