Small fixes and cleanup

This commit is contained in:
jacksonmj
2011-01-11 14:22:24 +00:00
parent 4006bdf4c2
commit daa6af0cc2
5 changed files with 12 additions and 12 deletions

View File

@@ -55,10 +55,10 @@ int update_ARAY(UPDATE_FUNC_ARGS) {
}
}
} else if (destroy) {
if (parts[r>>8].type==PT_BRAY) {
if ((r&0xFF)==PT_BRAY) {
parts[r>>8].life = 1;
docontinue = 1;
} else if (parts[r>>8].type==PT_INWR || parts[r>>8].type==PT_ARAY || parts[r>>8].type==PT_WIFI || parts[r>>8].type==PT_FILT || (parts[r>>8].type==PT_SWCH && parts[r>>8].life>=10)) {
} else if ((r&0xFF)==PT_INWR || (r&0xFF)==PT_ARAY || (r&0xFF)==PT_WIFI || (r&0xFF)==PT_FILT || ((r&0xFF)==PT_SWCH && parts[r>>8].life>=10)) {
docontinue = 1;
} else {
docontinue = 0;

View File

@@ -12,12 +12,12 @@ int update_BOYL(UPDATE_FUNC_ARGS) {
if (y+CELL<YRES)
pv[y/CELL+1][x/CELL+1] += 0.001f*((parts[i].temp/100)-pv[y/CELL+1][x/CELL+1]);
}
if (y+CELL>0 && pv[y/CELL-1][x/CELL]<(parts[i].temp/100))
if (y-CELL>=0 && pv[y/CELL-1][x/CELL]<(parts[i].temp/100))
pv[y/CELL-1][x/CELL] += 0.001f*((parts[i].temp/100)-pv[y/CELL-1][x/CELL]);
if (x+CELL>0)
if (x-CELL>=0)
{
pv[y/CELL][x/CELL-1] += 0.001f*((parts[i].temp/100)-pv[y/CELL][x/CELL-1]);
if (y+CELL>0)
if (y-CELL>=0)
pv[y/CELL-1][x/CELL-1] += 0.001f*((parts[i].temp/100)-pv[y/CELL-1][x/CELL-1]);
}
for (rx=-1; rx<2; rx++)

View File

@@ -54,17 +54,17 @@ int update_NEUT(UPDATE_FUNC_ARGS) {
#endif
}
else if ((r&0xFF)==PT_GUNP && 15>(rand()%1000))
part_change_type(i,x,y,PT_DUST);
part_change_type(r>>8,x+rx,y+ry,PT_DUST);
else if ((r&0xFF)==PT_DYST && 15>(rand()%1000))
part_change_type(i,x,y,PT_YEST);
part_change_type(r>>8,x+rx,y+ry,PT_YEST);
else if ((r&0xFF)==PT_YEST)
part_change_type(i,x,y,PT_DYST);
part_change_type(r>>8,x+rx,y+ry,PT_DYST);
else if ((r&0xFF)==PT_WATR && 15>(rand()%100))
part_change_type(r>>8,x+rx,y+ry,PT_DSTW);
else if ((r&0xFF)==PT_PLEX && 15>(rand()%1000))
part_change_type(i,x,y,PT_GOO);
part_change_type(r>>8,x+rx,y+ry,PT_GOO);
else if ((r&0xFF)==PT_NITR && 15>(rand()%1000))
part_change_type(i,x,y,PT_DESL);
part_change_type(r>>8,x+rx,y+ry,PT_DESL);
else if ((r&0xFF)==PT_PLNT && 5>(rand()%100))
create_part(r>>8, x+rx, y+ry, PT_WOOD);
else if ((r&0xFF)==PT_DESL && 15>(rand()%1000))

View File

@@ -19,7 +19,7 @@ int update_PRTI(UPDATE_FUNC_ARGS) {
portal[parts[i].tmp][count-1][nnx] = parts[r>>8].type;
portaltemp[parts[i].tmp][count-1][nnx] = parts[r>>8].temp;
portalctype[parts[i].tmp][count-1][nnx] = parts[r>>8].ctype;
if (parts[r>>8].type==PT_SPRK)
if ((r&0xFF)==PT_SPRK)
part_change_type(r>>8,x+rx,y+ry,parts[r>>8].ctype);
else
kill_part(r>>8);

View File

@@ -1355,7 +1355,7 @@ void update_particles_i(pixel *vid, int start, int inc)
continue;
}
if (bmap[y/CELL][x/CELL]==WL_DETECT && emap[y/CELL][x/CELL]<8)
set_emap(nx, ny);
set_emap(x/CELL, y/CELL);
vx[y/CELL][x/CELL] = vx[y/CELL][x/CELL]*ptypes[t].airloss + ptypes[t].airdrag*parts[i].vx;