Permalink
Browse files

fix for fast particles moving through VOID

  • Loading branch information...
jacob1 committed Nov 22, 2014
1 parent aa8fe86 commit 6da5b08fd23ec0519f2cea93cf61f6c6f2484293
Showing with 4 additions and 1 deletion.
  1. +4 −1 src/simulation/Simulation.cpp
@@ -4364,7 +4364,10 @@ void Simulation::update_particles_i(int start, int inc)
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;

0 comments on commit 6da5b08

Please sign in to comment.