From b9e16d4bc6a1a8e018a70f248abdb5aca8cb8133 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 25 Jul 2012 18:32:10 +0100 Subject: [PATCH] TPT: Prevent STKM falling through activated PVOD with a ctype that isn't STKM 637ee194e0c --- src/simulation/Simulation.cpp | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 596a2267d..9cac3cf48 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -1881,7 +1881,6 @@ void Simulation::init_can_move() for (t=0;t>8].life == 10) result = 1; + if (parts[r>>8].life == 10) + { + if(!parts[r>>8].ctype || (parts[r>>8].ctype==pt)!=(parts[r>>8].tmp&1)) + result = 1; + else + result = 0; + } else result = 0; } + if ((r&0xFF)==PT_VOID) + { + if(!parts[r>>8].ctype || (parts[r>>8].ctype==pt)!=(parts[r>>8].tmp&1)) + result = 1; + else + result = 0; + } } if (bmap[ny/CELL][nx/CELL]) { @@ -2084,8 +2097,8 @@ int Simulation::try_move(int i, int x, int y, int nx, int ny) } if ((r&0xFF)==PT_VOID || (r&0xFF)==PT_PVOD) //this is where void eats particles { - if(!parts[r>>8].ctype || (parts[r>>8].ctype==parts[i].type)!=(parts[r>>8].tmp&1)) - kill_part(i); + //void ctype already checked in eval_move + kill_part(i); return 0; } if ((r&0xFF)==PT_BHOL || (r&0xFF)==PT_NBHL) //this is where blackhole eats particles