mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-03-22 15:19:52 +01:00
Fix crash with really high speed photons, a check is needed here too
This commit is contained in:
parent
2708c379a1
commit
69d28bd7b0
@ -4111,6 +4111,15 @@ killed:
|
||||
// nothing found
|
||||
fin_xf = parts[i].x + parts[i].vx;
|
||||
fin_yf = parts[i].y + parts[i].vy;
|
||||
if (edgeMode == 2)
|
||||
{
|
||||
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)
|
||||
fin_yf = remainder_p(fin_yf-CELL+.5f, YRES-CELL*2.0f)+CELL-.5f;
|
||||
}
|
||||
fin_x = (int)(fin_xf+0.5f);
|
||||
fin_y = (int)(fin_yf+0.5f);
|
||||
clear_xf = fin_xf-dx;
|
||||
|
Loading…
x
Reference in New Issue
Block a user