mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-30 11:19:51 +02:00
fix particle #0 not being removed from the photons map when moving
This commit is contained in:
@@ -2726,9 +2726,12 @@ int Simulation::do_move(int i, int x, int y, float nxf, float nyf)
|
|||||||
parts[i].y = nyf;
|
parts[i].y = nyf;
|
||||||
if (ny!=y || nx!=x)
|
if (ny!=y || nx!=x)
|
||||||
{
|
{
|
||||||
if (ID(pmap[y][x])==i) pmap[y][x] = 0;
|
if (ID(pmap[y][x]) == i)
|
||||||
else if (ID(photons[y][x])==i) photons[y][x] = 0;
|
pmap[y][x] = 0;
|
||||||
if (nx<CELL || nx>=XRES-CELL || ny<CELL || ny>=YRES-CELL)//kill_part if particle is out of bounds
|
if (ID(photons[y][x]) == i)
|
||||||
|
photons[y][x] = 0;
|
||||||
|
// kill_part if particle is out of bounds
|
||||||
|
if (nx < CELL || nx >= XRES - CELL || ny < CELL || ny >= YRES - CELL)
|
||||||
{
|
{
|
||||||
kill_part(i);
|
kill_part(i);
|
||||||
return -1;
|
return -1;
|
||||||
|
Reference in New Issue
Block a user