summaryrefslogtreecommitdiff
path: root/src/simulation/tools/Air.cpp
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-08-14 15:29:07 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-08-14 15:29:07 (GMT)
commitb06f7f5b6db540a546f5677c1c8933e168df5e4c (patch)
tree63c5180fe9ce9a7af8d058f6a6bf60606f28400a /src/simulation/tools/Air.cpp
parente13476a4063bd7bdf428d53fd686864c1c90e0ec (diff)
downloadpowder-b06f7f5b6db540a546f5677c1c8933e168df5e4c.zip
powder-b06f7f5b6db540a546f5677c1c8933e168df5e4c.tar.gz
Air and heat tool limits, fixes #112
Diffstat (limited to 'src/simulation/tools/Air.cpp')
-rw-r--r--src/simulation/tools/Air.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/simulation/tools/Air.cpp b/src/simulation/tools/Air.cpp
index b7b1351..9fd7f79 100644
--- a/src/simulation/tools/Air.cpp
+++ b/src/simulation/tools/Air.cpp
@@ -12,6 +12,10 @@ Tool_Air::Tool_Air()
int Tool_Air::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength)
{
sim->air->pv[y/CELL][x/CELL] += 0.03f*strength;
+ if(sim->air->pv[y/CELL][x/CELL] > 256.0f)
+ sim->air->pv[y/CELL][x/CELL] = 256.0f;
+ if(sim->air->pv[y/CELL][x/CELL] < -256.0f)
+ sim->air->pv[y/CELL][x/CELL] = -256.0f;
return 1;
}