Skip to content

Commit

Permalink
fix ambient heat going to high negative values with high life LIGH, f…
Browse files Browse the repository at this point in the history
…ixes #536
  • Loading branch information
jacob1 committed Mar 4, 2018
1 parent f9b5c6b commit 2adae64
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions src/simulation/elements/LIGH.cpp
Expand Up @@ -73,9 +73,12 @@ int Element_LIGH::update(UPDATE_FUNC_ARGS)
//Element_FIRE::update(UPDATE_FUNC_SUBCALL_ARGS);
if (sim->aheat_enable)
{
sim->hv[y/CELL][x/CELL]+=powderful/50;
if (sim->hv[y/CELL][x/CELL]>MAX_TEMP)
sim->hv[y/CELL][x/CELL]=MAX_TEMP;
sim->hv[y/CELL][x/CELL] += powderful/50;
if (sim->hv[y/CELL][x/CELL] > MAX_TEMP)
sim->hv[y/CELL][x/CELL] = MAX_TEMP;
// If the LIGH was so powerful that it overflowed hv, set to max temp
else if (sim->hv[y/CELL][x/CELL] < 0)
sim->hv[y/CELL][x/CELL] = MAX_TEMP;
}

for (rx=-2; rx<3; rx++)
Expand Down

0 comments on commit 2adae64

Please sign in to comment.