summaryrefslogtreecommitdiff
path: root/src/simulation/elements/PHOT.cpp
diff options
context:
space:
mode:
authorcracker64 <cracker642@gmail.com>2013-02-27 22:20:05 (GMT)
committer cracker64 <cracker642@gmail.com>2013-02-27 22:20:05 (GMT)
commit08d1a68ce091b6ba53788224fd1bda92c1895ca6 (patch)
tree09593de4276750ce9abf203edb08741947ba7ab6 /src/simulation/elements/PHOT.cpp
parent3d2e59415003c51c0b6dbe764003cc2012ba9ca7 (diff)
downloadpowder-08d1a68ce091b6ba53788224fd1bda92c1895ca6.zip
powder-08d1a68ce091b6ba53788224fd1bda92c1895ca6.tar.gz
More fixes.
Diffstat (limited to 'src/simulation/elements/PHOT.cpp')
-rw-r--r--src/simulation/elements/PHOT.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/simulation/elements/PHOT.cpp b/src/simulation/elements/PHOT.cpp
index ac8c5c8..2c6c81f 100644
--- a/src/simulation/elements/PHOT.cpp
+++ b/src/simulation/elements/PHOT.cpp
@@ -58,14 +58,14 @@ int Element_PHOT::update(UPDATE_FUNC_ARGS)
return 1;
}
if (parts[i].temp > 506)
- if (1>rand()%10) Element_FIRE::update(UPDATE_FUNC_SUBCALL_ARGS);
+ if (!(rand()%10)) Element_FIRE::update(UPDATE_FUNC_SUBCALL_ARGS);
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES && (rx || ry)) {
r = pmap[y+ry][x+rx];
if (!r)
continue;
- if ((r&0xFF)==PT_ISOZ && 5>(rand()%2000))
+ if ((r&0xFF)==PT_ISOZ && !(rand()%400))
{
parts[i].vx *= 0.90;
parts[i].vy *= 0.90;
@@ -76,7 +76,7 @@ int Element_PHOT::update(UPDATE_FUNC_ARGS)
parts[r>>8].vy = rr*sinf(rrr);
sim->pv[y/CELL][x/CELL] -= 15.0f * CFDS;
}
- if ((r&0xFF)==PT_ISZS && 5>(rand()%2000))
+ if ((r&0xFF)==PT_ISZS && !(rand()%400))
{
parts[i].vx *= 0.90;
parts[i].vy *= 0.90;
@@ -89,7 +89,7 @@ int Element_PHOT::update(UPDATE_FUNC_ARGS)
}
}
r = pmap[y][x];
- if((r&0xFF) == PT_QRTZ && r)// && parts[i].ctype==0x3FFFFFFF)
+ if((r&0xFF) == PT_QRTZ)// && parts[i].ctype==0x3FFFFFFF)
{
float a = (rand()%360)*3.14159f/180.0f;
parts[i].vx = 3.0f*cosf(a);
@@ -138,4 +138,4 @@ int Element_PHOT::graphics(GRAPHICS_FUNC_ARGS)
}
-Element_PHOT::~Element_PHOT() {} \ No newline at end of file
+Element_PHOT::~Element_PHOT() {}