diff options
| author | cracker64 <cracker642@gmail.com> | 2013-02-27 05:11:23 (GMT) |
|---|---|---|
| committer | cracker64 <cracker642@gmail.com> | 2013-02-27 05:11:23 (GMT) |
| commit | 27e3e1251837f5d64e835068d5f5bd5b67b95921 (patch) | |
| tree | af6383f7df96485633c91ebcfbe6318ee927403f /src/simulation/elements/DTEC.cpp | |
| parent | a62467c74e9391dd2a9173cfa167d32eceed506b (diff) | |
| download | powder-27e3e1251837f5d64e835068d5f5bd5b67b95921.zip powder-27e3e1251837f5d64e835068d5f5bd5b67b95921.tar.gz | |
Small optimizations number 2.
Diffstat (limited to 'src/simulation/elements/DTEC.cpp')
| -rw-r--r-- | src/simulation/elements/DTEC.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/simulation/elements/DTEC.cpp b/src/simulation/elements/DTEC.cpp index 3fec023..5d0c68e 100644 --- a/src/simulation/elements/DTEC.cpp +++ b/src/simulation/elements/DTEC.cpp @@ -61,7 +61,7 @@ int Element_DTEC::update(UPDATE_FUNC_ARGS) r = pmap[y+ry][x+rx]; if (!r) continue; - rt = parts[r>>8].type; + rt = r&0xFF; if (sim->parts_avg(i,r>>8,PT_INSL) != PT_INSL) { if ((sim->elements[rt].Properties&PROP_CONDUCTS) && !(rt==PT_WATR||rt==PT_SLTW||rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR) && parts[r>>8].life==0) @@ -82,7 +82,7 @@ int Element_DTEC::update(UPDATE_FUNC_ARGS) r = sim->photons[y+ry][x+rx]; if(!r) continue; - if (parts[r>>8].type == parts[i].ctype && (parts[i].ctype != PT_LIFE || parts[i].tmp == parts[r>>8].ctype || !parts[i].tmp)) + if ((r&0xFF) == parts[i].ctype && (parts[i].ctype != PT_LIFE || parts[i].tmp == parts[r>>8].ctype || !parts[i].tmp)) parts[i].life = 1; } return 0; |
