summaryrefslogtreecommitdiff
path: root/src/simulation/elements/ACID.cpp
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2013-02-26 23:59:37 (GMT)
committer cracker64 <cracker642@gmail.com>2013-02-26 23:59:37 (GMT)
commit8250515e97db5ace3e87c612d855f09235b73969 (patch)
treeddbc36591a9043334b2fc684722ffd334894da83 /src/simulation/elements/ACID.cpp
parente700ff29883fcc3479ad8d9fce9805fbb0d31dfa (diff)
downloadpowder-8250515e97db5ace3e87c612d855f09235b73969.zip
powder-8250515e97db5ace3e87c612d855f09235b73969.tar.gz
Lots of small optimizations and things, nothing should be functionally different.
Only gotten through a few elements, more later.
Diffstat (limited to 'src/simulation/elements/ACID.cpp')
-rw-r--r--src/simulation/elements/ACID.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/simulation/elements/ACID.cpp b/src/simulation/elements/ACID.cpp
index fb6cb81..6501ba0 100644
--- a/src/simulation/elements/ACID.cpp
+++ b/src/simulation/elements/ACID.cpp
@@ -102,12 +102,12 @@ int Element_ACID::update(UPDATE_FUNC_ARGS)
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
{
r = pmap[y+ry][x+rx];
- if ((r>>8)>=NPART || !r)
+ if (!r)
continue;
- if ((r&0xFF)==PT_ACID&&(parts[i].life>parts[r>>8].life)&&parts[i].life>0)//diffusion
+ if ((r&0xFF)==PT_ACID && (parts[i].life>parts[r>>8].life) && parts[i].life>0)//diffusion
{
int temp = parts[i].life - parts[r>>8].life;
- if (temp ==1)
+ if (temp==1)
{
parts[r>>8].life ++;
parts[i].life --;
@@ -141,4 +141,4 @@ int Element_ACID::graphics(GRAPHICS_FUNC_ARGS)
}
-Element_ACID::~Element_ACID() {} \ No newline at end of file
+Element_ACID::~Element_ACID() {}