summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/simulation/elements/ELEC.cpp4
-rw-r--r--src/simulation/elements/H2.cpp14
2 files changed, 8 insertions, 10 deletions
diff --git a/src/simulation/elements/ELEC.cpp b/src/simulation/elements/ELEC.cpp
index 16bad1a..c0f92db 100644
--- a/src/simulation/elements/ELEC.cpp
+++ b/src/simulation/elements/ELEC.cpp
@@ -127,7 +127,7 @@ int Element_ELEC::update(UPDATE_FUNC_ARGS)
sim->kill_part(i);
return 1;
}
- if ((sim->elements[r&0xFF].Properties & PROP_CONDUCTS) && ((r&0xFF)!=PT_H2||parts[i].tmp!=1))
+ if ((sim->elements[r&0xFF].Properties & PROP_CONDUCTS) && ((r&0xFF)!=PT_H2||parts[i].temp<2273.15))
{
sim->create_part(-1, x+rx, y+ry, PT_SPRK);
sim->kill_part(i);
@@ -153,4 +153,4 @@ int Element_ELEC::graphics(GRAPHICS_FUNC_ARGS)
}
-Element_ELEC::~Element_ELEC() {} \ No newline at end of file
+Element_ELEC::~Element_ELEC() {}
diff --git a/src/simulation/elements/H2.cpp b/src/simulation/elements/H2.cpp
index a75fd13..1e84502 100644
--- a/src/simulation/elements/H2.cpp
+++ b/src/simulation/elements/H2.cpp
@@ -68,7 +68,7 @@ int Element_H2::update(UPDATE_FUNC_ARGS)
}
if (parts[r>>8].temp > 2273.15)// && pv[y/CELL][x/CELL] > 50.0f)
continue;
- if (parts[i].tmp != 1)
+ if (parts[i].temp < 2273.15)
{
if (rt==PT_FIRE)
{
@@ -87,27 +87,25 @@ int Element_H2::update(UPDATE_FUNC_ARGS)
}
if (parts[i].temp > 2273.15 && sim->pv[y/CELL][x/CELL] > 50.0f)
{
- parts[i].tmp = 1;
if (rand()%5 < 1)
{
int j;
float temp = parts[i].temp;
sim->part_change_type(i,x,y,PT_PLSM);
parts[i].life = rand()%150+50;
- sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT);
- sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC);
+ j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT); if (j != -1) parts[j].temp = temp;
+ j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_ELEC); if (j != -1) parts[j].temp = temp;
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_PHOT);
if (j != -1) { parts[j].ctype = 0xFFFF00; parts[j].temp = temp; }
- j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NBLE);
- if (j != -1) { parts[j].tmp = 1; parts[j].temp = temp; }
+ j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NBLE); if (j != -1) parts[j].temp = temp;
if (rand()%2)
{
j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NBLE);
if (j != -1) { parts[j].tmp = 1; parts[j].temp = temp; }
}
- parts[i].temp += 6000;
+ parts[i].temp += 750+rand()%500;
sim->pv[y/CELL][x/CELL] += 30;
}
}
@@ -115,4 +113,4 @@ int Element_H2::update(UPDATE_FUNC_ARGS)
}
-Element_H2::~Element_H2() {} \ No newline at end of file
+Element_H2::~Element_H2() {}