mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-06 16:36:32 +02:00
Fix crash with really high speed photons, a check is needed here too
This commit is contained in:
@@ -4111,6 +4111,15 @@ killed:
|
|||||||
// nothing found
|
// nothing found
|
||||||
fin_xf = parts[i].x + parts[i].vx;
|
fin_xf = parts[i].x + parts[i].vx;
|
||||||
fin_yf = parts[i].y + parts[i].vy;
|
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_x = (int)(fin_xf+0.5f);
|
||||||
fin_y = (int)(fin_yf+0.5f);
|
fin_y = (int)(fin_yf+0.5f);
|
||||||
clear_xf = fin_xf-dx;
|
clear_xf = fin_xf-dx;
|
||||||
|
Reference in New Issue
Block a user