From 1a6427ba32522787971a8576094543befa27dd35 Mon Sep 17 00:00:00 2001 From: Zeno Rogue Date: Sat, 18 Aug 2018 17:37:12 +0200 Subject: [PATCH] some arrays had number bounds while it should have been MAX_EDGE --- floorshapes.cpp | 2 +- game.cpp | 10 +++++----- netgen.cpp | 2 +- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/floorshapes.cpp b/floorshapes.cpp index 55664511..82d0a72f 100644 --- a/floorshapes.cpp +++ b/floorshapes.cpp @@ -39,7 +39,7 @@ hyperpoint adist(ld a, ld x) { return spin(a) * xpush(x) * C0; } -typedef pair> matrixitem; +typedef pair> matrixitem; struct mesher { eGeometry g; diff --git a/game.cpp b/game.cpp index efe0c405..7f95b415 100644 --- a/game.cpp +++ b/game.cpp @@ -3850,7 +3850,7 @@ void determinizeBull(cell *c, int *posdir, int& nc) { // determinize the Angry Beast movement: // use the previous PC's positions as the tiebreaker for(int k=0; k1; k++) { - int pts[10]; + int pts[MAX_EDGE]; for(int d=0; dmove(posdir[d]), k); int bestpts = 1000; @@ -3875,7 +3875,7 @@ int determinizeBullPush(cellwalker bull) { return 1; } -int posdir[10], nc; +int posdir[MAX_EDGE], nc; int pickMoveDirection(cell *c, flagtype mf) { int bestval = stayval(c, mf); @@ -3898,7 +3898,7 @@ int pickMoveDirection(cell *c, flagtype mf) { } int pickDownDirection(cell *c, flagtype mf) { - int downs[10], qdowns = 0; + int downs[MAX_EDGE], qdowns = 0; int bestdif = -100; forCellIdEx(c2, i, c) { if(gravityLevel(c2) < gravityLevel(c) && passable_for(c->monst, c2, c, P_MIRROR) && @@ -4609,7 +4609,7 @@ void groupmove(eMonster movtype, flagtype mf) { for(int i=0; itype; t++) if(c->move(t) && inpair(c->move(t), colorpair)) dirtable[qdirtable++] = t; diff --git a/netgen.cpp b/netgen.cpp index cc172cf8..7eb2a024 100644 --- a/netgen.cpp +++ b/netgen.cpp @@ -58,7 +58,7 @@ namespace hr { namespace netgen { char patek[MAXCELLS][MAX_EDGE]; // data generated by HyperRogue - hyperpoint hcenter[MAXCELLS][9]; + hyperpoint hcenter[MAXCELLS][MAX_EDGE+1]; // Functions handling the data. //==============================