From 323a850e16d0c26e10167985dce6f43c0c869c14 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 11 Apr 2020 23:51:56 -0400 Subject: [PATCH] Don't delete SPRK/METL in detector wall, don't allow drawing metal on detector wall This fixes the only valid bug on the "Glitches" wiki page. All the rest were already fixed (multi-head stkm) or are not bugs (lava ice, "destroying" dmnd with dray) --- src/simulation/Simulation.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 9dc497561..428c54e0f 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -3153,6 +3153,8 @@ int Simulation::create_part(int p, int x, int y, int t, int v) } else if (IsWallBlocking(x, y, t)) return -1; + else if (bmap[y/CELL][x/CELL]==WL_DETECT && elements[t].Properties & TYPE_SOLID) + return -1; else if (photons[y][x] && (elements[t].Properties & TYPE_ENERGY)) return -1; } @@ -3415,8 +3417,7 @@ void Simulation::UpdateParticles(int start, int end) (bmap[y/CELL][x/CELL]==WL_ALLOWLIQUID && !(elements[t].Properties&TYPE_LIQUID)) || (bmap[y/CELL][x/CELL]==WL_ALLOWPOWDER && !(elements[t].Properties&TYPE_PART)) || (bmap[y/CELL][x/CELL]==WL_ALLOWGAS && !(elements[t].Properties&TYPE_GAS)) || //&& elements[t].Falldown!=0 && parts[i].type!=PT_FIRE && parts[i].type!=PT_SMKE && parts[i].type!=PT_CFLM) || - (bmap[y/CELL][x/CELL]==WL_ALLOWENERGY && !(elements[t].Properties&TYPE_ENERGY)) || - (bmap[y/CELL][x/CELL]==WL_DETECT && (t==PT_METL || t==PT_SPRK)) || + (bmap[y/CELL][x/CELL]==WL_ALLOWENERGY && !(elements[t].Properties&TYPE_ENERGY)) || (bmap[y/CELL][x/CELL]==WL_EWALL && !emap[y/CELL][x/CELL])) && (t!=PT_STKM) && (t!=PT_STKM2) && (t!=PT_FIGH))) { kill_part(i);