summaryrefslogtreecommitdiff
path: root/src/elements/sing.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@Simons-Mac-Pro.local>2012-04-30 20:49:40 (GMT)
committer Simon Robertshaw <simon@Simons-Mac-Pro.local>2012-04-30 20:49:40 (GMT)
commit211770e8189b426287adad3d924c20cac203fbd1 (patch)
tree51b335ff8e73a4bbfb017a0de4dc7c2f68be05dd /src/elements/sing.c
parent8397b6e51aa817f2b33347bc801fdaee0b4d2700 (diff)
parent433c1881bc37ea257999b88eee920c19a92798c5 (diff)
downloadpowder-211770e8189b426287adad3d924c20cac203fbd1.zip
powder-211770e8189b426287adad3d924c20cac203fbd1.tar.gz
Merge branch 'master' of github.com:FacialTurd/The-Powder-Toy
Diffstat (limited to 'src/elements/sing.c')
-rw-r--r--src/elements/sing.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/elements/sing.c b/src/elements/sing.c
index d6fc273..3e17fe0 100644
--- a/src/elements/sing.c
+++ b/src/elements/sing.c
@@ -15,21 +15,21 @@ int update_SING(UPDATE_FUNC_ARGS) {
if (y+CELL<YRES)
pv[y/CELL+1][x/CELL+1] += 0.1f*(singularity-pv[y/CELL+1][x/CELL+1]);
}
- if (y+CELL>0 && pv[y/CELL-1][x/CELL]<singularity)
+ if (y-CELL>=0 && pv[y/CELL-1][x/CELL]<singularity)
pv[y/CELL-1][x/CELL] += 0.1f*(singularity-pv[y/CELL-1][x/CELL]);
- if (x+CELL>0)
+ if (x-CELL>=0)
{
pv[y/CELL][x/CELL-1] += 0.1f*(singularity-pv[y/CELL][x/CELL-1]);
- if (y+CELL>0)
+ if (y-CELL>=0)
pv[y/CELL-1][x/CELL-1] += 0.1f*(singularity-pv[y/CELL-1][x/CELL-1]);
}
if (parts[i].life<1) {
//Pop!
- for (rx=-2; rx<3; rx++) {
+ for (rx=-1; rx<2; rx++) {
crx = (x/CELL)+rx;
- for (ry=-2; ry<3; ry++) {
+ for (ry=-1; ry<2; ry++) {
cry = (y/CELL)+ry;
- if (cry > 0 && crx > 0 && crx < (XRES/CELL) && cry < (YRES/CELL)) {
+ if (cry >= 0 && crx >= 0 && crx < (XRES/CELL) && cry < (YRES/CELL)) {
pv[cry][crx] += (float)parts[i].tmp;
}
}