Skip to content

Commit

Permalink
fixes to ELEC (missed from 6dc7eaf), FUSE (changed in 27e3e12), and I…
Browse files Browse the repository at this point in the history
…RON (changed in 0d70547)
  • Loading branch information
jacob1 committed Nov 6, 2014
1 parent 66a530f commit 43bab35
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
1 change: 1 addition & 0 deletions src/simulation/elements/ELEC.cpp
Expand Up @@ -87,6 +87,7 @@ int Element_ELEC::update(UPDATE_FUNC_ARGS)
sim->create_part(r>>8, x+rx, y+ry, PT_O2);
else
sim->create_part(r>>8, x+rx, y+ry, PT_H2);
sim->kill_part(i);
return 1;
case PT_PROT: // this is the correct reaction, not NEUT, but leaving NEUT in anyway
if (parts[r>>8].tmp2 & 0x1)
Expand Down
6 changes: 3 additions & 3 deletions src/simulation/elements/FUSE.cpp
Expand Up @@ -80,10 +80,10 @@ int Element_FUSE::update(UPDATE_FUNC_ARGS)
r = pmap[y+ry][x+rx];
if (!r)
continue;
if ((r&0xFF)==PT_SPRK || ((parts[i].temp>=(273.15+700.0f)) && parts[i].life>40 && !(rand()%20)))
if ((r&0xFF)==PT_SPRK || (parts[i].temp>=(273.15+700.0f) && !(rand()%20)))
{
parts[i].life = 39;

if (parts[i].life > 40)
parts[i].life = 39;
}
}
return 0;
Expand Down
10 changes: 6 additions & 4 deletions src/simulation/elements/IRON.cpp
Expand Up @@ -50,6 +50,8 @@ Element_IRON::Element_IRON()
int Element_IRON::update(UPDATE_FUNC_ARGS)
{
int r, rx, ry, rt;
if (!parts[i].life)
return 0;
for (rx=-1; rx<2; rx++)
for (ry=-1; ry<2; ry++)
if (BOUNDS_CHECK && (rx || ry))
Expand All @@ -58,19 +60,19 @@ int Element_IRON::update(UPDATE_FUNC_ARGS)
switch (r&0xFF)
{
case PT_SALT:
if (!(parts[i].life) && !(rand()%47))
if (!(rand()%47))
goto succ;
break;
case PT_SLTW:
if (!(parts[i].life) && !(rand()%67))
if (!(rand()%67))
goto succ;
break;
case PT_WATR:
if (!(parts[i].life) && !(rand()%1200))
if (!(rand()%1200))
goto succ;
break;
case PT_O2:
if (!(parts[i].life) && !(rand()%250))
if (!(rand()%250))
goto succ;
break;
case PT_LO2:
Expand Down

0 comments on commit 43bab35

Please sign in to comment.