summaryrefslogtreecommitdiff
path: root/src/simulation/elements/FRZW.cpp
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2013-02-27 05:11:23 (GMT)
committer cracker64 <cracker642@gmail.com>2013-02-27 05:11:23 (GMT)
commit27e3e1251837f5d64e835068d5f5bd5b67b95921 (patch)
treeaf6383f7df96485633c91ebcfbe6318ee927403f /src/simulation/elements/FRZW.cpp
parenta62467c74e9391dd2a9173cfa167d32eceed506b (diff)
downloadpowder-27e3e1251837f5d64e835068d5f5bd5b67b95921.zip
powder-27e3e1251837f5d64e835068d5f5bd5b67b95921.tar.gz
Small optimizations number 2.
Diffstat (limited to 'src/simulation/elements/FRZW.cpp')
-rw-r--r--src/simulation/elements/FRZW.cpp12
1 files changed, 3 insertions, 9 deletions
diff --git a/src/simulation/elements/FRZW.cpp b/src/simulation/elements/FRZW.cpp
index 5bdbb21..b48cd6f 100644
--- a/src/simulation/elements/FRZW.cpp
+++ b/src/simulation/elements/FRZW.cpp
@@ -57,18 +57,12 @@ int Element_FRZW::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
- if ((r&0xFF)==PT_WATR&&5>rand()%70)
+ if ((r&0xFF)==PT_WATR && !(rand()%14))
{
sim->part_change_type(r>>8,x+rx,y+ry,PT_FRZW);
}
}
- if (parts[i].life==0&&13>rand()%2500)
- {
- sim->part_change_type(i,x,y,PT_ICEI);
- parts[i].ctype=PT_FRZW;
- parts[i].temp = restrict_flt(parts[i].temp-200.0f, MIN_TEMP, MAX_TEMP);
- }
- else if ((100-(parts[i].life))>rand()%50000)
+ if ((parts[i].life==0 && !(rand()%192)) || (100-(parts[i].life))>rand()%50000 )
{
sim->part_change_type(i,x,y,PT_ICEI);
parts[i].ctype=PT_FRZW;
@@ -78,4 +72,4 @@ int Element_FRZW::update(UPDATE_FUNC_ARGS)
}
-Element_FRZW::~Element_FRZW() {} \ No newline at end of file
+Element_FRZW::~Element_FRZW() {}