Block solids from being created in detect wall in IsWallBlocking instead, fixes #881

This commit is contained in:
jacob1 2022-12-19 21:38:35 -05:00
parent 74adc9e4b2
commit 299781bf13
No known key found for this signature in database
GPG Key ID: 4E58A32D510E1995

View File

@ -2328,6 +2328,8 @@ bool Simulation::IsWallBlocking(int x, int y, int type)
return true;
else if (wall == WL_EWALL && !emap[y/CELL][x/CELL])
return true;
else if (wall == WL_DETECT && (elements[type].Properties&TYPE_SOLID))
return true;
}
return false;
}
@ -3225,8 +3227,6 @@ int Simulation::create_part(int p, int x, int y, int t, int v)
}
else if (IsWallBlocking(x, y, t))
return -1;
else if (bmap[y/CELL][x/CELL]==WL_DETECT && elements[t].Properties & TYPE_SOLID)
return -1;
else if (photons[y][x] && (elements[t].Properties & TYPE_ENERGY))
return -1;
}