diff options
| author | cracker64 <cracker642@gmail.com> | 2013-02-28 05:40:36 (GMT) |
|---|---|---|
| committer | cracker64 <cracker642@gmail.com> | 2013-02-28 05:40:36 (GMT) |
| commit | c65081d3ed44a97cea0f41a63e9ec07cf0feb5f2 (patch) | |
| tree | 90744a56bc618c12aab5ef617445b283ce2d6d57 /src/simulation/elements/PQRT.cpp | |
| parent | 08d1a68ce091b6ba53788224fd1bda92c1895ca6 (diff) | |
| download | powder-c65081d3ed44a97cea0f41a63e9ec07cf0feb5f2.zip powder-c65081d3ed44a97cea0f41a63e9ec07cf0feb5f2.tar.gz | |
Finished first pass-through for all elements.
Will get a few more places later.
Diffstat (limited to 'src/simulation/elements/PQRT.cpp')
| -rw-r--r-- | src/simulation/elements/PQRT.cpp | 23 |
1 files changed, 6 insertions, 17 deletions
diff --git a/src/simulation/elements/PQRT.cpp b/src/simulation/elements/PQRT.cpp index 8c51947..bb03f08 100644 --- a/src/simulation/elements/PQRT.cpp +++ b/src/simulation/elements/PQRT.cpp @@ -49,17 +49,7 @@ Element_PQRT::Element_PQRT() //#TPT-Directive ElementHeader Element_PQRT static int update(UPDATE_FUNC_ARGS) int Element_PQRT::update(UPDATE_FUNC_ARGS) { - int r, tmp, trade, rx, ry, np, t; - t = parts[i].type; - if (t == PT_QRTZ) - { - parts[i].pavg[0] = parts[i].pavg[1]; - parts[i].pavg[1] = sim->pv[y/CELL][x/CELL]; - if (parts[i].pavg[1]-parts[i].pavg[0] > 0.05*(parts[i].temp/3) || parts[i].pavg[1]-parts[i].pavg[0] < -0.05*(parts[i].temp/3)) - { - sim->part_change_type(i,x,y,PT_PQRT); - } - } + int r, tmp, trade, rx, ry, np; // absorb SLTW if (parts[i].ctype!=-1) for (rx=-2; rx<3; rx++) @@ -69,7 +59,7 @@ int Element_PQRT::update(UPDATE_FUNC_ARGS) r = pmap[y+ry][x+rx]; if (!r) continue; - else if ((r&0xFF)==PT_SLTW && (1>rand()%2500)) + else if ((r&0xFF)==PT_SLTW && !(rand()%2500)) { sim->kill_part(r>>8); parts[i].ctype ++; @@ -92,15 +82,14 @@ int Element_PQRT::update(UPDATE_FUNC_ARGS) { parts[np].tmp = parts[i].tmp; parts[i].ctype--; - if (5>rand()%10) + if (rand()%2) { parts[np].ctype=-1;//dead qrtz } - else if (!parts[i].ctype && 1>rand()%15) + else if (!parts[i].ctype && !(rand()%15)) { parts[i].ctype=-1; } - break; } } @@ -119,7 +108,7 @@ int Element_PQRT::update(UPDATE_FUNC_ARGS) r = pmap[y+ry][x+rx]; if (!r) continue; - if ((r&0xFF)==t && (parts[i].ctype>parts[r>>8].ctype) && parts[r>>8].ctype>=0 )//diffusion + if ((r&0xFF)==PT_PQRT && (parts[i].ctype>parts[r>>8].ctype) && parts[r>>8].ctype>=0 )//diffusion { tmp = parts[i].ctype - parts[r>>8].ctype; if (tmp ==1) @@ -165,4 +154,4 @@ int Element_PQRT::graphics(GRAPHICS_FUNC_ARGS) } -Element_PQRT::~Element_PQRT() {}
\ No newline at end of file +Element_PQRT::~Element_PQRT() {} |
