Skip to content

Commit

Permalink
fix for fast particles moving through VOID
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob1 committed Nov 22, 2014
1 parent aa8fe86 commit 6da5b08
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/simulation/Simulation.cpp
Expand Up @@ -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;
Expand Down

0 comments on commit 6da5b08

Please sign in to comment.