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/FRZZ.cpp | |
| parent | a62467c74e9391dd2a9173cfa167d32eceed506b (diff) | |
| download | powder-27e3e1251837f5d64e835068d5f5bd5b67b95921.zip powder-27e3e1251837f5d64e835068d5f5bd5b67b95921.tar.gz | |
Small optimizations number 2.
Diffstat (limited to 'src/simulation/elements/FRZZ.cpp')
| -rw-r--r-- | src/simulation/elements/FRZZ.cpp | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/src/simulation/elements/FRZZ.cpp b/src/simulation/elements/FRZZ.cpp index 47a5c0f..106766d 100644 --- a/src/simulation/elements/FRZZ.cpp +++ b/src/simulation/elements/FRZZ.cpp @@ -57,20 +57,17 @@ int Element_FRZZ::update(UPDATE_FUNC_ARGS) r = pmap[y+ry][x+rx]; if (!r) continue; - if ((r&0xFF)==PT_WATR&&5>rand()%100) + if ((r&0xFF)==PT_WATR && !(rand()%20)) { sim->part_change_type(r>>8,x+rx,y+ry,PT_FRZW); parts[r>>8].life = 100; - parts[i].type = PT_NONE; + sim->kill_part(i); + return 1; } } - if (parts[i].type==PT_NONE) { - sim->kill_part(i); - return 1; - } return 0; } -Element_FRZZ::~Element_FRZZ() {}
\ No newline at end of file +Element_FRZZ::~Element_FRZZ() {} |
