summaryrefslogtreecommitdiff
path: root/src/simulation/elements/BOYL.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/simulation/elements/BOYL.cpp')
-rw-r--r--src/simulation/elements/BOYL.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/simulation/elements/BOYL.cpp b/src/simulation/elements/BOYL.cpp
index 18ebee8..3a02d65 100644
--- a/src/simulation/elements/BOYL.cpp
+++ b/src/simulation/elements/BOYL.cpp
@@ -76,19 +76,23 @@ int Element_BOYL::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
- if ((r&0xFF)==PT_WATR && 1>rand()%30)
+ if ((r&0xFF)==PT_WATR)
{
- sim->part_change_type(r>>8,x+rx,y+ry,PT_FOG);
+ if (!(rand()%30))
+ sim->part_change_type(r>>8,x+rx,y+ry,PT_FOG);
}
- else if ((r&0xFF)==PT_O2 && 1>rand()%9)
+ else if ((r&0xFF)==PT_O2)
{
- sim->kill_part(r>>8);
- sim->part_change_type(i,x,y,PT_WATR);
- sim->pv[y/CELL][x/CELL] += 4.0;
+ if (!(rand()%9))
+ {
+ sim->kill_part(r>>8);
+ sim->part_change_type(i,x,y,PT_WATR);
+ sim->pv[y/CELL][x/CELL] += 4.0;
+ }
}
}
return 0;
}
-Element_BOYL::~Element_BOYL() {} \ No newline at end of file
+Element_BOYL::~Element_BOYL() {}