From 1494f8237ce8dcf7479efd259251eb7fd2fc2f17 Mon Sep 17 00:00:00 2001 From: Sourec Date: Thu, 11 Jun 2015 14:29:59 -0400 Subject: [PATCH 1/3] Fixed FIRE, SMKE, and CO2 passing through the powder-only wall. --- src/simulation/Simulation.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 8219d4cf6..5d6242b1a 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -1859,7 +1859,7 @@ bool Simulation::IsWallBlocking(int x, int y, int type) return true; else if (wall == WL_ALLOWLIQUID && elements[type].Falldown!=2) return true; - else if (wall == WL_ALLOWSOLID && elements[type].Falldown!=1) + else if (wall == WL_ALLOWSOLID && (elements[type].Falldown!=1 || type == PT_CO2 || type == PT_FIRE || type == PT_SMKE)) return true; else if (wall == WL_ALLOWAIR || wall == WL_WALL || wall == WL_WALLELEC) return true; @@ -2065,7 +2065,7 @@ int Simulation::eval_move(int pt, int nx, int ny, unsigned *rr) return 0; if (bmap[ny/CELL][nx/CELL]==WL_ALLOWLIQUID && elements[pt].Falldown!=2) return 0; - if (bmap[ny/CELL][nx/CELL]==WL_ALLOWSOLID && elements[pt].Falldown!=1) + if (bmap[ny/CELL][nx/CELL]==WL_ALLOWSOLID && (elements[pt].Falldown!=1 || pt == PT_FIRE || pt == PT_SMKE || pt || PT_CO2)) return 0; if (bmap[ny/CELL][nx/CELL]==WL_ALLOWAIR || bmap[ny/CELL][nx/CELL]==WL_WALL || bmap[ny/CELL][nx/CELL]==WL_WALLELEC) return 0; From bbe0c34d3e548e3c7c3c715e83236711ae174e18 Mon Sep 17 00:00:00 2001 From: Sourec Date: Thu, 11 Jun 2015 16:25:39 -0400 Subject: [PATCH 2/3] Switched an OR to an AND That was leftover from when I was rewriting a bit of this. Sorry! --- src/simulation/Simulation.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 5d6242b1a..93b7ef7ef 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -2065,7 +2065,7 @@ int Simulation::eval_move(int pt, int nx, int ny, unsigned *rr) return 0; if (bmap[ny/CELL][nx/CELL]==WL_ALLOWLIQUID && elements[pt].Falldown!=2) return 0; - if (bmap[ny/CELL][nx/CELL]==WL_ALLOWSOLID && (elements[pt].Falldown!=1 || pt == PT_FIRE || pt == PT_SMKE || pt || PT_CO2)) + if (bmap[ny/CELL][nx/CELL]==WL_ALLOWSOLID && (elements[pt].Falldown!=1 || pt == PT_FIRE || pt == PT_SMKE || pt == PT_CO2)) return 0; if (bmap[ny/CELL][nx/CELL]==WL_ALLOWAIR || bmap[ny/CELL][nx/CELL]==WL_WALL || bmap[ny/CELL][nx/CELL]==WL_WALLELEC) return 0; From 4e8335b0708ec038733486c28b3f676fcf0b7e52 Mon Sep 17 00:00:00 2001 From: Sourec Date: Thu, 11 Jun 2015 16:31:21 -0400 Subject: [PATCH 3/3] Changed falldown values for FIRE, CO2, and SMKE to zero, reverted changes to collision/placement logic --- src/simulation/Simulation.cpp | 4 ++-- src/simulation/elements/CO2.cpp | 2 +- src/simulation/elements/FIRE.cpp | 2 +- src/simulation/elements/SMKE.cpp | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 93b7ef7ef..8219d4cf6 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -1859,7 +1859,7 @@ bool Simulation::IsWallBlocking(int x, int y, int type) return true; else if (wall == WL_ALLOWLIQUID && elements[type].Falldown!=2) return true; - else if (wall == WL_ALLOWSOLID && (elements[type].Falldown!=1 || type == PT_CO2 || type == PT_FIRE || type == PT_SMKE)) + else if (wall == WL_ALLOWSOLID && elements[type].Falldown!=1) return true; else if (wall == WL_ALLOWAIR || wall == WL_WALL || wall == WL_WALLELEC) return true; @@ -2065,7 +2065,7 @@ int Simulation::eval_move(int pt, int nx, int ny, unsigned *rr) return 0; if (bmap[ny/CELL][nx/CELL]==WL_ALLOWLIQUID && elements[pt].Falldown!=2) return 0; - if (bmap[ny/CELL][nx/CELL]==WL_ALLOWSOLID && (elements[pt].Falldown!=1 || pt == PT_FIRE || pt == PT_SMKE || pt == PT_CO2)) + if (bmap[ny/CELL][nx/CELL]==WL_ALLOWSOLID && elements[pt].Falldown!=1) return 0; if (bmap[ny/CELL][nx/CELL]==WL_ALLOWAIR || bmap[ny/CELL][nx/CELL]==WL_WALL || bmap[ny/CELL][nx/CELL]==WL_WALLELEC) return 0; diff --git a/src/simulation/elements/CO2.cpp b/src/simulation/elements/CO2.cpp index bafebb014..08c38f2d8 100644 --- a/src/simulation/elements/CO2.cpp +++ b/src/simulation/elements/CO2.cpp @@ -17,7 +17,7 @@ Element_CO2::Element_CO2() Gravity = 0.1f; Diffusion = 1.0f; HotAir = 0.000f * CFDS; - Falldown = 1; + Falldown = 0; Flammable = 0; Explosive = 0; diff --git a/src/simulation/elements/FIRE.cpp b/src/simulation/elements/FIRE.cpp index aea421773..e822a74e5 100644 --- a/src/simulation/elements/FIRE.cpp +++ b/src/simulation/elements/FIRE.cpp @@ -17,7 +17,7 @@ Element_FIRE::Element_FIRE() Gravity = -0.1f; Diffusion = 0.00f; HotAir = 0.001f * CFDS; - Falldown = 1; + Falldown = 0; Flammable = 0; Explosive = 0; diff --git a/src/simulation/elements/SMKE.cpp b/src/simulation/elements/SMKE.cpp index 4a993a30a..1643c96df 100644 --- a/src/simulation/elements/SMKE.cpp +++ b/src/simulation/elements/SMKE.cpp @@ -17,7 +17,7 @@ Element_SMKE::Element_SMKE() Gravity = -0.1f; Diffusion = 0.00f; HotAir = 0.001f * CFDS; - Falldown = 1; + Falldown = 0; Flammable = 0; Explosive = 0;