From 6da5b08fd23ec0519f2cea93cf61f6c6f2484293 Mon Sep 17 00:00:00 2001 From: jacob1 Date: Sat, 22 Nov 2014 13:04:04 -0500 Subject: [PATCH] fix for fast particles moving through VOID --- src/simulation/Simulation.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 93f67ab94..e2d6b6a6e 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -4364,7 +4364,10 @@ killed: clear_y = (int)(clear_yf+0.5f); break; } - if (!eval_move(t, fin_x, fin_y, NULL) || (t == PT_PHOT && pmap[fin_y][fin_x]) || bmap[fin_y/CELL][fin_x/CELL]==WL_DESTROYALL) + //block if particle can't move (0), or some special cases where it returns 1 (can_move = 3 but returns 1 meaning particle will be eaten) + //also photons are still blocked (slowed down) by any particle (even ones it can move through), and absorb wall also blocks particles + int eval = eval_move(t, fin_x, fin_y, NULL); + if (!eval || (can_move[t][pmap[fin_y][fin_x]&0xFF] == 3 && eval == 1) || (t == PT_PHOT && pmap[fin_y][fin_x]) || bmap[fin_y/CELL][fin_x/CELL]==WL_DESTROYALL) { // found an obstacle clear_xf = fin_xf-dx;