summaryrefslogtreecommitdiff
path: root/src/simulation/elements/BOYL.cpp
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2013-02-28 17:37:16 (GMT)
committer cracker64 <cracker642@gmail.com>2013-02-28 17:37:16 (GMT)
commit5873d6958641af21b92fcb039d26c336331f19e7 (patch)
treea334e74d7cf79726f5c0a411515bed801ee0333f /src/simulation/elements/BOYL.cpp
parentc65081d3ed44a97cea0f41a63e9ec07cf0feb5f2 (diff)
downloadpowder-5873d6958641af21b92fcb039d26c336331f19e7.zip
powder-5873d6958641af21b92fcb039d26c336331f19e7.tar.gz
Going through again.
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() {}