diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index d25c0ed4da..61014fdaab 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -4097,8 +4097,8 @@ void Simulation::UpdateParticles(int start, int end) fin_y = (int)(fin_yf+0.5f); if (edgeMode == 2) { - bool x_ok = (fin_x >= CELL && fin_x < XRES-CELL); - bool y_ok = (fin_y >= CELL && fin_y < YRES-CELL); + bool x_ok = (fin_xf >= CELL-.5f && fin_xf < XRES-CELL-.5f); + bool y_ok = (fin_yf >= CELL-.5f && fin_yf < YRES-CELL-.5f); if (!x_ok) fin_xf = remainder_p(fin_xf-CELL+.5f, XRES-CELL*2.0f)+CELL-.5f; if (!y_ok) @@ -4186,8 +4186,8 @@ void Simulation::UpdateParticles(int start, int end) if (stickman) for (int i = 0; i < 16; i+=2) { - stickman->legs[i] += (nx-oldnx)+.5f; - stickman->legs[i+1] += (ny-oldny)+.5f; + stickman->legs[i] += (nx-oldnx); + stickman->legs[i+1] += (ny-oldny); stickman->accs[i/2] *= .95f; } parts[i].vy *= .95f;