Skip to content

Commit

Permalink
Prevent diffusion of stored water between GEL and SPNG if no water is…
Browse files Browse the repository at this point in the history
… stored

Reported by camtech56 in http://tpt.io/.293650
  • Loading branch information
jacksonmj committed Jul 25, 2016
1 parent adb200d commit fdb5390
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/simulation/elements/GEL.cpp
Expand Up @@ -100,13 +100,16 @@ int Element_GEL::update(UPDATE_FUNC_ARGS)
}
break;
case PT_SPNG:
if (parts[i].tmp<100 && ((parts[r>>8].life+1)>parts[i].tmp))
// Concentration diffusion
if (parts[r>>8].life>0 && parts[i].tmp<100 && ((parts[r>>8].life+1)>parts[i].tmp))
{
// SPNG -> GEL
parts[r>>8].life--;
parts[i].tmp++;
}
else if ((parts[r>>8].life+1)<parts[i].tmp)//Concentration diffusion
else if (parts[i].tmp>0 && (parts[r>>8].life+1)<parts[i].tmp)
{
// SPNG <- GEL (saturation limit of SPNG is ignored here)
parts[r>>8].life++;
parts[i].tmp--;
}
Expand Down

0 comments on commit fdb5390

Please sign in to comment.