diff options
| author | jacob1 <jfu614@gmail.com> | 2013-06-07 03:23:48 (GMT) |
|---|---|---|
| committer | jacob1 <jfu614@gmail.com> | 2013-06-07 03:28:07 (GMT) |
| commit | e146ae50abc021cbff765aa73327408c7d4661ea (patch) | |
| tree | 8f1686a726d6e64d3dce313e3b1f2708aa4b7661 /src/simulation/tools/Vac.cpp | |
| parent | 76b92952b12f0eeaedbf3f2e4231dbd72b6d902a (diff) | |
| download | powder-e146ae50abc021cbff765aa73327408c7d4661ea.zip powder-e146ae50abc021cbff765aa73327408c7d4661ea.tar.gz | |
some minor changes to tools
Diffstat (limited to 'src/simulation/tools/Vac.cpp')
| -rw-r--r-- | src/simulation/tools/Vac.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/src/simulation/tools/Vac.cpp b/src/simulation/tools/Vac.cpp index 86beb54..eded57c 100644 --- a/src/simulation/tools/Vac.cpp +++ b/src/simulation/tools/Vac.cpp @@ -1,20 +1,21 @@ #include "ToolClasses.h" #include "simulation/Air.h" -//#TPT-Directive ToolClass Tool_Vac TOOL_VAC 2 +//#TPT-Directive ToolClass Tool_Vac TOOL_VAC 3 Tool_Vac::Tool_Vac() { Identifier = "DEFAULT_TOOL_VAC"; Name = "VAC"; Colour = PIXPACK(0x303030); - Description = "Reduces air pressure"; + Description = "Vacuum, reduces air pressure."; } int Tool_Vac::Perform(Simulation * sim, Particle * cpart, int x, int y, float strength) { - sim->air->pv[y/CELL][x/CELL] -= strength*0.05f;; - if(sim->air->pv[y/CELL][x/CELL] > 256.0f) + sim->air->pv[y/CELL][x/CELL] -= strength*0.05f; + + 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) + else if (sim->air->pv[y/CELL][x/CELL] < -256.0f) sim->air->pv[y/CELL][x/CELL] = -256.0f; return 1; } |
