summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-07-08 12:08:40 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-07-12 13:47:41 (GMT)
commit52b4473f0f1bba1fbf0bed28b21b80145b65809d (patch)
treec7bfb7f590af8bd4cd4260b6b44c60fd37f71ba2 /src
parent812acd6663b194592f9379467de06a5eae2f6851 (diff)
downloadpowder-52b4473f0f1bba1fbf0bed28b21b80145b65809d.zip
powder-52b4473f0f1bba1fbf0bed28b21b80145b65809d.tar.gz
Fix bounds check for WIND line
Diffstat (limited to 'src')
-rw-r--r--src/main.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/main.c b/src/main.c
index 633b2fe..e8ece5c 100644
--- a/src/main.c
+++ b/src/main.c
@@ -3043,7 +3043,7 @@ int main(int argc, char *argv[])
{
for (j=-bsy; j<=bsy; j++)
for (i=-bsx; i<=bsx; i++)
- if (x+i>0 && y+j>0 && x+i<XRES && y+j<YRES && ((CURRENT_BRUSH==CIRCLE_BRUSH && (pow(i,2))/(pow(bsx,2))+(pow(j,2))/(pow(bsy,2))<=1)||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=bsy*bsx)))
+ if (lx+i>=0 && ly+j>=0 && lx+i<XRES && ly+j<YRES && ((CURRENT_BRUSH==CIRCLE_BRUSH && pow(i,2)*pow(bsy,2)+pow(j,2)*pow(bsx,2)<=pow(bsx,2)*pow(bsy,2))||(CURRENT_BRUSH==SQUARE_BRUSH&&i*j<=bsy*bsx)))
{
vx[(ly+j)/CELL][(lx+i)/CELL] += (x-lx)*0.002f;
vy[(ly+j)/CELL][(lx+i)/CELL] += (y-ly)*0.002f;