summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCracker64 <cracker642@gmail.com>2011-03-07 05:32:04 (GMT)
committer Cracker64 <cracker642@gmail.com>2011-03-07 05:32:04 (GMT)
commitca1cd0da065a1774dbeeba161139f580ab7f711a (patch)
tree1542a0c9fd31553ffd6fe52e81c40f3887baee4c /src
parent13e90886c1d4ae571707c8f31a7702fce7b2ec74 (diff)
downloadpowder-ca1cd0da065a1774dbeeba161139f580ab7f711a.zip
powder-ca1cd0da065a1774dbeeba161139f580ab7f711a.tar.gz
check bounds for wind, causes some funny glitches though.
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 178a38b..6795f51 100644
--- a/src/main.c
+++ b/src/main.c
@@ -2440,7 +2440,7 @@ int main(int argc, char *argv[])
{
for (j=-bsy; j<=bsy; j++)
for (i=-bsx; i<=bsx; i++)
- if ((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 (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)))
{
vx[(y+j)/CELL][(x+i)/CELL] += (x-lx)*0.01f;
vy[(y+j)/CELL][(x+i)/CELL] += (y-ly)*0.01f;