summaryrefslogtreecommitdiff
path: root/src/simulation/elements/SING.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/elements/SING.cpp')
-rw-r--r--src/simulation/elements/SING.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/simulation/elements/SING.cpp b/src/simulation/elements/SING.cpp
index ea0c8c7..8bd3f24 100644
--- a/src/simulation/elements/SING.cpp
+++ b/src/simulation/elements/SING.cpp
@@ -63,21 +63,21 @@ int Element_SING::update(UPDATE_FUNC_ARGS)
if (y+CELL<YRES)
sim->pv[y/CELL+1][x/CELL+1] += 0.1f*(singularity-sim->pv[y/CELL+1][x/CELL+1]);
}
- if (y+CELL>0 && sim->pv[y/CELL-1][x/CELL]<singularity)
+ if (y-CELL>=0 && sim->pv[y/CELL-1][x/CELL]<singularity)
sim->pv[y/CELL-1][x/CELL] += 0.1f*(singularity-sim->pv[y/CELL-1][x/CELL]);
- if (x+CELL>0)
+ if (x-CELL>=0)
{
sim->pv[y/CELL][x/CELL-1] += 0.1f*(singularity-sim->pv[y/CELL][x/CELL-1]);
- if (y+CELL>0)
+ if (y-CELL>=0)
sim->pv[y/CELL-1][x/CELL-1] += 0.1f*(singularity-sim->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)) {
sim->pv[cry][crx] += (float)parts[i].tmp;
}
}
@@ -152,4 +152,4 @@ int Element_SING::update(UPDATE_FUNC_ARGS)
}
-Element_SING::~Element_SING() {} \ No newline at end of file
+Element_SING::~Element_SING() {}