summaryrefslogtreecommitdiff
path: root/src/simulation/elements/ANAR.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/ANAR.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/ANAR.cpp')
-rw-r--r--src/simulation/elements/ANAR.cpp46
1 files changed, 23 insertions, 23 deletions
diff --git a/src/simulation/elements/ANAR.cpp b/src/simulation/elements/ANAR.cpp
index f8bcd49..6dd500f 100644
--- a/src/simulation/elements/ANAR.cpp
+++ b/src/simulation/elements/ANAR.cpp
@@ -49,30 +49,30 @@ Element_ANAR::Element_ANAR()
//#TPT-Directive ElementHeader Element_ANAR static int update(UPDATE_FUNC_ARGS)
int Element_ANAR::update(UPDATE_FUNC_ARGS)
{
- int r, rx, ry;
+ int r, rx, ry;
- //if (parts[i].temp >= 0.23)
- // parts[i].temp --;
- for (rx=-2; rx<3; rx++)
- for (ry=-2; ry<3; ry++)
- if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
- {
- r = pmap[y+ry][x+rx];
- if (!r)
- continue;
- if ((r&0xFF)==PT_HFLM)
- {
- if (1>rand()%22)
- {
- sim->part_change_type(i,x,y,PT_HFLM);
- parts[i].life = rand()%150+50;
- parts[r>>8].temp = parts[i].temp = 0;
- sim->pv[y/CELL][x/CELL] -= 0.5;
- }
- }
- }
- return 0;
+ //if (parts[i].temp >= 0.23)
+ // parts[i].temp --;
+ for (rx=-2; rx<3; rx++)
+ for (ry=-2; ry<3; ry++)
+ if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
+ {
+ r = pmap[y+ry][x+rx];
+ if (!r)
+ continue;
+ if ((r&0xFF)==PT_HFLM)
+ {
+ if (1>rand()%22)
+ {
+ sim->part_change_type(i,x,y,PT_HFLM);
+ parts[i].life = rand()%150+50;
+ parts[r>>8].temp = parts[i].temp = 0;
+ sim->pv[y/CELL][x/CELL] -= 0.5;
+ }
+ }
+ }
+ return 0;
}
-Element_ANAR::~Element_ANAR() {} \ No newline at end of file
+Element_ANAR::~Element_ANAR() {}