From a138fa09526d3bbda2e9eafe30ef2b0109d86a63 Mon Sep 17 00:00:00 2001 From: Jesse Ruderman Date: Sun, 11 Jul 2021 04:07:32 -0700 Subject: [PATCH] Fix array indexing in totalbulldistance --- monstermove.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/monstermove.cpp b/monstermove.cpp index 5b7edd96..ea3a1bfc 100644 --- a/monstermove.cpp +++ b/monstermove.cpp @@ -567,7 +567,7 @@ EX int totalbulldistance(cell *c, int k) { shpos.resize(SHSIZE); int tbd = 0; for(int p: player_indices()) { - cell *c2 = shpos[p][(cshpos+SHSIZE-k-1)%SHSIZE]; + cell *c2 = shpos[(cshpos+SHSIZE-k-1)%SHSIZE][p]; if(c2) tbd += bulldistance(c, c2); } return tbd;