summaryrefslogtreecommitdiff
path: root/src/simulation/elements/ICEI.cpp
diff options
context:
space:
mode:
authorSaveliy Skresanov <savask@yandex.ru>2013-03-16 16:03:02 (GMT)
committer Saveliy Skresanov <savask@yandex.ru>2013-03-16 16:03:02 (GMT)
commit43974d8537195f5dabc239562b35874335b949f7 (patch)
tree8a3e613de9f265c99fbf9ffde5f3f142eb575721 /src/simulation/elements/ICEI.cpp
parentd383d6d7e5e1d3ca0856c02ebbcea5e9b8b2ff4e (diff)
downloadpowder-43974d8537195f5dabc239562b35874335b949f7.zip
powder-43974d8537195f5dabc239562b35874335b949f7.tar.gz
Narrowed loops for all elements in the first list.
Probabilities might be messed up a bit, I'm not sure.
Diffstat (limited to 'src/simulation/elements/ICEI.cpp')
-rw-r--r--src/simulation/elements/ICEI.cpp8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/simulation/elements/ICEI.cpp b/src/simulation/elements/ICEI.cpp
index 74386a6..9449b4a 100644
--- a/src/simulation/elements/ICEI.cpp
+++ b/src/simulation/elements/ICEI.cpp
@@ -54,8 +54,8 @@ int Element_ICEI::update(UPDATE_FUNC_ARGS)
{
parts[i].temp = restrict_flt(parts[i].temp-1.0f, MIN_TEMP, MAX_TEMP);
}
- for (rx=-2; rx<3; rx++)
- for (ry=-2; ry<3; ry++)
+ for (rx=-1; rx<2; rx++)
+ for (ry=-1; ry<2; ry++)
if (BOUNDS_CHECK && (rx || ry))
{
r = pmap[y+ry][x+rx];
@@ -63,14 +63,14 @@ int Element_ICEI::update(UPDATE_FUNC_ARGS)
continue;
if ((r&0xFF)==PT_SALT || (r&0xFF)==PT_SLTW)
{
- if (parts[i].temp > sim->elements[PT_SLTW].LowTemperature && !(rand()%1000))
+ if (parts[i].temp > sim->elements[PT_SLTW].LowTemperature && !(rand()%333))
{
sim->part_change_type(i,x,y,PT_SLTW);
sim->part_change_type(r>>8,x+rx,y+ry,PT_SLTW);
return 0;
}
}
- else if (((r&0xFF)==PT_FRZZ) && (parts[i].ctype=PT_FRZW) && !(rand()%1000))
+ else if (((r&0xFF)==PT_FRZZ) && (parts[i].ctype=PT_FRZW) && !(rand()%333))
sim->part_change_type(r>>8,x+rx,y+ry,PT_ICEI);
}
return 0;