mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-26 09:24:28 +02:00
Fix crash with spark flood fill
This commit is contained in:
@@ -1447,14 +1447,15 @@ int Simulation::FloodParts(int x, int y, int fullc, int cm, int flags)
|
||||
if (cm==-1)
|
||||
{
|
||||
//if initial flood point is out of bounds, do nothing
|
||||
if (c != 0 && (x < CELL || x >= XRES-CELL || y < CELL || y >= YRES-CELL))
|
||||
if (c != 0 && (x < CELL || x >= XRES-CELL || y < CELL || y >= YRES-CELL || c == PT_SPRK))
|
||||
return 1;
|
||||
else if (x < 0 || x >= XRES || y < 0 || y >= YRES)
|
||||
return 1;
|
||||
if (c==0)
|
||||
if (c == 0)
|
||||
{
|
||||
cm = pmap[y][x]&0xFF;
|
||||
if (!cm)
|
||||
{
|
||||
cm = photons[y][x]&0xFF;
|
||||
if (!cm)
|
||||
{
|
||||
@@ -1464,6 +1465,7 @@ int Simulation::FloodParts(int x, int y, int fullc, int cm, int flags)
|
||||
return -1;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
cm = 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user