Always check bmap when creating particles
This commit is contained in:
parent
df504330e2
commit
e506934655
@ -32,9 +32,6 @@ int update_DEUT(UPDATE_FUNC_ARGS) {
|
||||
r = pmap[y+ry][x+rx];
|
||||
if (parts[i].life<=maxlife)
|
||||
continue;
|
||||
if ((bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_WALLELEC||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_EWALL||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_DESTROYALL||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_WALL||
|
||||
bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_ALLOWAIR||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_ALLOWSOLID||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_ALLOWGAS))
|
||||
continue;
|
||||
if ((!r)&&parts[i].life>=1)//if nothing then create deut
|
||||
{
|
||||
np = create_part(-1,x+rx,y+ry,PT_DEUT);
|
||||
|
@ -32,9 +32,6 @@ int update_MERC(UPDATE_FUNC_ARGS) {
|
||||
r = pmap[y+ry][x+rx];
|
||||
if (parts[i].tmp<=maxtmp)
|
||||
continue;
|
||||
if ((bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_WALLELEC||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_EWALL||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_DESTROYALL||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_WALL||
|
||||
bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_ALLOWAIR||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_ALLOWSOLID||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_ALLOWGAS))
|
||||
continue;
|
||||
if ((!r)&&parts[i].tmp>=1)//if nothing then create deut
|
||||
{
|
||||
np = create_part(-1,x+rx,y+ry,PT_MERC);
|
||||
|
@ -130,7 +130,7 @@ int update_PIPE(UPDATE_FUNC_ARGS) {
|
||||
if (x+rx>=0 && y+ry>=0 && x+rx<XRES && y+ry<YRES)
|
||||
{
|
||||
r = pmap[y+ry][x+rx];
|
||||
if (surround_space && !r && (parts[i].tmp&0xFF)!=0 && eval_move(parts[i].tmp&0xFF, x+rx, y+ry, NULL)) //creating at end
|
||||
if (surround_space && !r && (parts[i].tmp&0xFF)!=0) //creating at end
|
||||
{
|
||||
np = create_part(-1,x+rx,y+ry,parts[i].tmp&0xFF);
|
||||
if (np!=-1)
|
||||
|
@ -24,13 +24,10 @@ int update_SPNG(UPDATE_FUNC_ARGS) {
|
||||
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
|
||||
{
|
||||
r = pmap[y+ry][x+rx];
|
||||
if ((bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_WALLELEC||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_EWALL||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_DESTROYALL||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_WALL||
|
||||
bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_ALLOWAIR||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_ALLOWSOLID||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_ALLOWGAS))
|
||||
continue;
|
||||
if ((!r)&&parts[i].life>=1)//if nothing then create water
|
||||
{
|
||||
create_part(-1,x+rx,y+ry,PT_WATR);
|
||||
parts[i].life--;
|
||||
np = create_part(-1,x+rx,y+ry,PT_WATR);
|
||||
if (np>-1) parts[i].life--;
|
||||
}
|
||||
}
|
||||
for ( trade = 0; trade<9; trade ++)
|
||||
@ -90,8 +87,6 @@ int update_SPNG(UPDATE_FUNC_ARGS) {
|
||||
if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry))
|
||||
{
|
||||
r = pmap[y+ry][x+rx];
|
||||
if ((bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_WALLELEC||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_ALLOWLIQUID||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_DESTROYALL||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_WALL||bmap[(y+ry)/CELL][(x+rx)/CELL]==WL_ALLOWSOLID))
|
||||
continue;
|
||||
if ((!r)&&parts[i].life>=1)//if nothing then create steam
|
||||
{
|
||||
np = create_part(-1,x+rx,y+ry,PT_WTRV);
|
||||
@ -99,11 +94,11 @@ int update_SPNG(UPDATE_FUNC_ARGS) {
|
||||
{
|
||||
parts[np].temp = parts[i].temp;
|
||||
tmp--;
|
||||
}
|
||||
parts[i].life--;
|
||||
parts[i].temp -= 20.0f;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (tmp>0)
|
||||
{
|
||||
if (parts[i].life>tmp)
|
||||
|
@ -732,7 +732,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
|
||||
return -1;
|
||||
if (p==-1)//creating from anything but brush
|
||||
{
|
||||
if (pmap[y][x])
|
||||
if (pmap[y][x] || (bmap[y/CELL][x/CELL] && !eval_move(t, x, y, NULL)))
|
||||
{
|
||||
if ((pmap[y][x]&0xFF)!=PT_SPAWN&&(pmap[y][x]&0xFF)!=PT_SPAWN2)
|
||||
{
|
||||
|
Loading…
Reference in New Issue
Block a user