diff options
Diffstat (limited to 'src/simulation/elements/FSEP.cpp')
| -rw-r--r-- | src/simulation/elements/FSEP.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/src/simulation/elements/FSEP.cpp b/src/simulation/elements/FSEP.cpp index 52e4a67..132e0de 100644 --- a/src/simulation/elements/FSEP.cpp +++ b/src/simulation/elements/FSEP.cpp @@ -55,11 +55,12 @@ int Element_FSEP::update(UPDATE_FUNC_ARGS) if (r!=-1) parts[r].life = 50; return 1; - } else if (parts[i].life < 40) { + } + else if (parts[i].life < 40) { parts[i].life--; - if ((rand()%10)==0) { - r = sim->create_part(-1, (rx=x+rand()%3-1), (ry=y+rand()%3-1), PT_PLSM); - if (r!=-1) + if (!(rand()%10)) { + r = sim->create_part(-1, x+rand()%3-1, y+rand()%3-1, PT_PLSM); + if (r>-1) parts[r].life = 50; } } @@ -71,11 +72,9 @@ int Element_FSEP::update(UPDATE_FUNC_ARGS) r = pmap[y+ry][x+rx]; if (!r) continue; - if (((r&0xFF)==PT_SPRK || (parts[i].temp>=(273.15+400.0f))) && 1>(rand()%15)) + if (((r&0xFF)==PT_SPRK || (parts[i].temp>=(273.15+400.0f))) && parts[i].life>40 && !(rand()%15)) { - if (parts[i].life>40) { - parts[i].life = 39; - } + parts[i].life = 39; } } } @@ -83,4 +82,4 @@ int Element_FSEP::update(UPDATE_FUNC_ARGS) } -Element_FSEP::~Element_FSEP() {}
\ No newline at end of file +Element_FSEP::~Element_FSEP() {} |
