Permalink
Browse files

Increase speed of MIX tool and make it work with liquids (#306)

* Make MIX tool work with liquids and gases
  • Loading branch information...
cxi authored and jacob1 committed Jul 13, 2016
1 parent 5b52585 commit 7251f645e4600b0cebc777acb200097405bde820
Showing with 2 additions and 2 deletions.
  1. +2 −2 src/simulation/simtools/Mix.cpp
@@ -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);
@@ -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;

0 comments on commit 7251f64

Please sign in to comment.