summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorJacob1 <jfu614@gmail.com>2012-04-05 23:31:52 (GMT)
committer Jacob1 <jfu614@gmail.com>2012-05-24 15:02:42 (GMT)
commite4686724ac4203568b82002bc849df55c9205f8c (patch)
treea0389f68e871fd18d0cce97b7fc0b3baf0715785 /src/elements
parente79d18c58cb6a1cd5c744643fa10cadaea93a71d (diff)
downloadpowder-e4686724ac4203568b82002bc849df55c9205f8c.zip
powder-e4686724ac4203568b82002bc849df55c9205f8c.tar.gz
limit amount of ELEC produced to prevent infinite reactions
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/O2.c2
-rw-r--r--src/elements/co2.c2
-rw-r--r--src/elements/h2.c2
-rw-r--r--src/elements/nble.c2
4 files changed, 4 insertions, 4 deletions
diff --git a/src/elements/O2.c b/src/elements/O2.c
index 737b571..5152478 100644
--- a/src/elements/O2.c
+++ b/src/elements/O2.c
@@ -18,7 +18,7 @@
int update_O2(UPDATE_FUNC_ARGS)
{
int r,rx,ry;
- if (parts[i].temp < 9773.15)
+ if (parts[i].temp < 9273.15)
{
for (rx=-2; rx<3; rx++)
for (ry=-2; ry<3; ry++)
diff --git a/src/elements/co2.c b/src/elements/co2.c
index 3f73288..acdbc99 100644
--- a/src/elements/co2.c
+++ b/src/elements/co2.c
@@ -49,7 +49,7 @@ int update_CO2(UPDATE_FUNC_ARGS) {
int j;
kill_part(i);
j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT); if (j != -1) parts[j].temp = 15000;
- j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC); if (j != -1) parts[j].temp = 15000;
+ if (!(rand()%50)) { j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC); if (j != -1) parts[j].temp = 15000; }
j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_O2); if (j != -1) parts[j].temp = 15000;
if (rand()%1000 < 1) { j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_SING); if (j != -1) { parts[j].temp = 15000; parts[i].life = 3; } }
diff --git a/src/elements/h2.c b/src/elements/h2.c
index d03cd50..86c3be3 100644
--- a/src/elements/h2.c
+++ b/src/elements/h2.c
@@ -61,7 +61,7 @@ int update_H2(UPDATE_FUNC_ARGS)
part_change_type(i,x,y,PT_PLSM);
parts[i].life = rand()%150+50;
j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT); if (j != -1) parts[j].temp = temp;
- j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC); if (j != -1) parts[j].temp = temp;
+ if (!(rand()%10)) { j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC); if (j != -1) parts[j].temp = temp; }
j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PHOT);
if (j != -1) { parts[j].ctype = 0xFFFF00; parts[j].temp = temp; }
diff --git a/src/elements/nble.c b/src/elements/nble.c
index dea5787..0c118ed 100644
--- a/src/elements/nble.c
+++ b/src/elements/nble.c
@@ -26,7 +26,7 @@ int update_NBLE(UPDATE_FUNC_ARGS)
part_change_type(i,x,y,PT_PLSM);
parts[i].life = rand()%150+50;
j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT); if (j != -1) parts[j].temp = temp;
- j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC); if (j != -1) parts[j].temp = temp;
+ if (!(rand()%25)) { j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC); if (j != -1) parts[j].temp = temp; }
j = create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PHOT);
if (j != -1) { parts[j].ctype = 0xFF0000; parts[j].temp = temp; }