about summary refs log tree commit diff
path: root/src/run.go
diff options
context:
space:
mode:
Diffstat (limited to 'src/run.go')
-rw-r--r--src/run.go8
1 files changed, 3 insertions, 5 deletions
diff --git a/src/run.go b/src/run.go
index a422ddf..7b346cb 100644
--- a/src/run.go
+++ b/src/run.go
@@ -15,13 +15,11 @@ func stepIn(r2p *r2pipe.Pipe) {
 	_ = r2cmd(r2p, "aes")
 }
 
-func switchPlayer(r2p *r2pipe.Pipe, currentPlayer int, config Config) int {
+// switchPlayer returns the id of the next Player
+func switchPlayer(r2p *r2pipe.Pipe, currentPlayer int, config *Config) int {
 
 	// calculate the index of the nextPlayer
-	nextPlayer := (currentPlayer + 1) % len(config.Bots)
-
-	// restore the registers to the state of the next bot
-	r2cmd(r2p, config.Bots[nextPlayer].Regs)
+	nextPlayer := (currentPlayer + 1) % config.AmountOfBots
 
 	return nextPlayer
 }