Skip to content

Commit

Permalink
Increase speed of MIX tool and make it work with liquids (#306)
Browse files Browse the repository at this point in the history
* Make MIX tool work with liquids and gases
  • Loading branch information
cxi authored and jacob1 committed Jul 13, 2016
1 parent 5b52585 commit 7251f64
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/simulation/simtools/Mix.cpp
Expand Up @@ -19,7 +19,7 @@ int Tool_Mix::Perform(Simulation * sim, Particle * cpart, int x, int y, float st

int distance = (int)(std::pow(strength, .5f) * 10);

if(!(sim->elements[thisPart&0xFF].Properties & TYPE_PART))
if(!(sim->elements[thisPart&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS)))
return 0;

int newX = x + (rand() % distance) - (distance/2);
Expand All @@ -32,7 +32,7 @@ int Tool_Mix::Perform(Simulation * sim, Particle * cpart, int x, int y, float st
if(!thatPart)
return 0;

if(!(sim->elements[thatPart&0xFF].Properties & TYPE_PART))
if(!(sim->elements[thatPart&0xFF].Properties & (TYPE_PART | TYPE_LIQUID | TYPE_GAS)))
return 0;

sim->pmap[y][x] = thatPart;
Expand Down

0 comments on commit 7251f64

Please sign in to comment.