Skip to content

Commit

Permalink
still allow NBLE to ionize at high temperatures (probably won't inter…
Browse files Browse the repository at this point in the history
…fere with fusion)
  • Loading branch information
jacob1 committed Apr 26, 2014
1 parent 4dae152 commit df1aac8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 6 deletions.
1 change: 1 addition & 0 deletions src/simulation/elements/H2.cpp
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion src/simulation/elements/NBLE.cpp
Expand Up @@ -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;
Expand Down
10 changes: 5 additions & 5 deletions src/simulation/elements/SPRK.cpp
Expand Up @@ -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)
Expand Down Expand Up @@ -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;
}
Expand Down Expand Up @@ -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:
Expand Down

0 comments on commit df1aac8

Please sign in to comment.