diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-24 19:36:23 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-08-24 19:36:23 (GMT) |
| commit | ae3c9ddf3950c42cc68e1eca73fe84fdd8eddfd0 (patch) | |
| tree | 37177522eb2a0a170e03f50a3d925af5f4458d8a /src/simulation/Gravity.cpp | |
| parent | 98da88e34fc67eed1a9e1a7f1387be4bb9d4c9a8 (diff) | |
| download | powder-ae3c9ddf3950c42cc68e1eca73fe84fdd8eddfd0.zip powder-ae3c9ddf3950c42cc68e1eca73fe84fdd8eddfd0.tar.gz | |
Don't you just hate those fencepost errors... Stop going out of bounds when traversing the X axis with gravity mask.
Diffstat (limited to 'src/simulation/Gravity.cpp')
| -rw-r--r-- | src/simulation/Gravity.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/simulation/Gravity.cpp b/src/simulation/Gravity.cpp index e5daa65..552c02d 100644 --- a/src/simulation/Gravity.cpp +++ b/src/simulation/Gravity.cpp @@ -420,13 +420,13 @@ void Gravity::grav_mask_r(int x, int y, char checkmap[YRES/CELL][XRES/CELL], cha *shapeout = 1; int x1 = x, x2 = x; - while (x1 >= 0) + while (x1 >= 1) { if(checkmap[y][x1-1] || bmap[y][x1-1]==WL_GRAV) break; x1--; } - while (x2 < XRES/CELL) + while (x2 < (XRES/CELL)-1) { if(checkmap[y][x2+1] || bmap[y][x2+1]==WL_GRAV) break; |
