summaryrefslogtreecommitdiff
path: root/src/simulation/elements/BMTL.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/BMTL.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/BMTL.cpp')
-rw-r--r--src/simulation/elements/BMTL.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/src/simulation/elements/BMTL.cpp b/src/simulation/elements/BMTL.cpp
index adc5289..26c086b 100644
--- a/src/simulation/elements/BMTL.cpp
+++ b/src/simulation/elements/BMTL.cpp
@@ -60,8 +60,7 @@ int Element_BMTL::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
- rt = parts[r>>8].type;
- if ((rt==PT_METL || rt==PT_IRON) && 1>(rand()/(RAND_MAX/100)))
+ if (((r&0xFF)==PT_METL || (r&0xFF)==PT_IRON) && 1>(rand()/(RAND_MAX/100)))
{
sim->part_change_type(r>>8,x+rx,y+ry,PT_BMTL);
parts[r>>8].tmp=(parts[i].tmp<=7)?parts[i].tmp=1:parts[i].tmp-(rand()%5);//rand()/(RAND_MAX/300)+100;
@@ -77,4 +76,4 @@ int Element_BMTL::update(UPDATE_FUNC_ARGS)
}
-Element_BMTL::~Element_BMTL() {} \ No newline at end of file
+Element_BMTL::~Element_BMTL() {}