diff options
| author | cracker64 <cracker642@gmail.com> | 2013-02-26 23:59:37 (GMT) |
|---|---|---|
| committer | cracker64 <cracker642@gmail.com> | 2013-02-26 23:59:37 (GMT) |
| commit | 8250515e97db5ace3e87c612d855f09235b73969 (patch) | |
| tree | ddbc36591a9043334b2fc684722ffd334894da83 /src/simulation/elements/BREC.cpp | |
| parent | e700ff29883fcc3479ad8d9fce9805fbb0d31dfa (diff) | |
| download | powder-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/BREC.cpp')
| -rw-r--r-- | src/simulation/elements/BREC.cpp | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/src/simulation/elements/BREC.cpp b/src/simulation/elements/BREC.cpp index e260a7c..f5ae4a1 100644 --- a/src/simulation/elements/BREC.cpp +++ b/src/simulation/elements/BREC.cpp @@ -50,13 +50,18 @@ Element_BREC::Element_BREC() int Element_BREC::update(UPDATE_FUNC_ARGS) { int np; - if (1>rand()%200 && (sim->pv[y/CELL][x/CELL] > 30.0f) && parts[i].temp>9000 && parts[i].life>0) + if (parts[i].life) { - sim->part_change_type(i, x ,y ,PT_EXOT); - parts[i].life = 1000; - } - if ((sim->pv[y/CELL][x/CELL] > 10.0f) && (parts[i].life>0)) { - parts[i].temp = parts[i].temp + (sim->pv[y/CELL][x/CELL])/8; + if (sim->pv[y/CELL][x/CELL]>10.0f) + { + if (parts[i].temp>9000 && sim->pv[y/CELL][x/CELL]>30.0f && 1>rand()%200) + { + sim->part_change_type(i, x ,y ,PT_EXOT); + parts[i].life = 1000; + } + parts[i].temp = parts[i].temp + (sim->pv[y/CELL][x/CELL])/8; + } + } return 0; } |
