Permalink
Browse files

still allow NBLE to ionize at high temperatures (probably won't inter…

…fere with fusion)
  • Loading branch information...
jacob1 committed Apr 26, 2014
1 parent 4dae152 commit df1aac818062a752c9352db9e1630e79e2ebcfae
Showing with 7 additions and 6 deletions.
  1. +1 −0 src/simulation/elements/H2.cpp
  2. +1 −1 src/simulation/elements/NBLE.cpp
  3. +5 −5 src/simulation/elements/SPRK.cpp
@@ -96,6 +96,7 @@ int Element_H2::update(UPDATE_FUNC_ARGS)
int j;
float temp = parts[i].temp;
sim->create_part(i,x,y,PT_NBLE);
parts[i].tmp = 0x1;

j = sim->create_part(-3,x+rand()%3-1,y+rand()%3-1,PT_NEUT);
if (j>-1)
@@ -51,7 +51,7 @@ int Element_NBLE::update(UPDATE_FUNC_ARGS)
{
if (parts[i].temp > 5273.15 && sim->pv[y/CELL][x/CELL] > 100.0f)
{
parts[i].tmp = 1;
parts[i].tmp |= 0x1;
if (!(rand()%5))
{
int j;
@@ -48,8 +48,8 @@ Element_SPRK::Element_SPRK()

//#TPT-Directive ElementHeader Element_SPRK static int update(UPDATE_FUNC_ARGS)
int Element_SPRK::update(UPDATE_FUNC_ARGS)
{
int r, rx, ry, rt, conduct_sprk, nearp, pavg, ct = parts[i].ctype, sender, receiver;
{
int r, rx, ry, nearp, pavg, ct = parts[i].ctype, sender, receiver;
Element_FIRE::update(UPDATE_FUNC_SUBCALL_ARGS);

if (parts[i].life<=0)
@@ -96,13 +96,13 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS)
}
break;
case PT_NBLE:
if (parts[i].life<=1 && parts[i].temp<5273.15f)
if (parts[i].life<=1 && !(parts[i].tmp&0x1))
{
parts[i].life = rand()%150+50;
sim->part_change_type(i,x,y,PT_PLSM);
parts[i].ctype = PT_NBLE;
if (parts[i].temp > 5273.15)
parts[i].tmp |= 4;
parts[i].tmp |= 0x4;
parts[i].temp = 3500;
sim->pv[y/CELL][x/CELL] += 1;
}
@@ -302,7 +302,7 @@ int Element_SPRK::update(UPDATE_FUNC_ARGS)
goto conduct;
continue;
case PT_NBLE:
if (parts[i].temp < 5273.15f)
if (!(parts[i].tmp&0x1))
goto conduct;
continue;
case PT_PSCN:

0 comments on commit df1aac8

Please sign in to comment.