From 5c65d69dacfb8fda234c71b78f55a849d246fcc2 Mon Sep 17 00:00:00 2001 From: Cracker64 Date: Tue, 18 Jan 2011 00:45:14 -0500 Subject: [PATCH] missed some bitshifts, which caused a few glitches. Everything seems normal --- src/powder.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/src/powder.c b/src/powder.c index 3e5883c76..71ca46da1 100644 --- a/src/powder.c +++ b/src/powder.c @@ -248,7 +248,7 @@ int try_move(int i, int x, int y, int nx, int ny) if(parts[i].type == PT_PHOT) return 1; - e = r >> 8; + e = r >> 12; if(r && e> 8].temp; + parts[i].temp = parts[pmap[ny][nx] >> 12].temp; parts[i].tmp = 0; photons[ny][nx] = PT_PHOT|(i<<12); @@ -902,7 +902,7 @@ static void create_cherenkov_photon(int pp) parts[i].life = 680; parts[i].x = parts[pp].x; parts[i].y = parts[pp].y; - parts[i].temp = parts[pmap[ny][nx] >> 8].temp; + parts[i].temp = parts[pmap[ny][nx] >> 12].temp; parts[i].tmp = 0; photons[ny][nx] = PT_PHOT|(i<<12); @@ -1301,7 +1301,7 @@ void update_particles_i(pixel *vid, int start, int inc) { r = pmap[ny][nx]; int neighbors = gol2[nx][ny][0]; - if(neighbors==0 || !(ptypes[r&0xFFF].properties&PROP_LIFE || !r&0xFFF) || (r>>12)>=NPART) + if(neighbors==0 || (r>>12)>=NPART || !(ptypes[r&0xFFF].properties&PROP_LIFE || !(r&0xFFF))) continue; for( golnum = 1;golnum> 8; + lt = pmap[ny][nx] >> 12; if(!parts[lt].ctype) parts[lt].ctype = PT_PHOT; } @@ -5147,7 +5147,7 @@ killed: s = 1; break; } - if((pmap[y][j]&255)!=t || (bmap[y/CELL][j/CELL] && bmap[y/CELL][j/CELL]!=WL_STREAM)) + if((pmap[y][j]&0xFFF)!=t || (bmap[y/CELL][j/CELL] && bmap[y/CELL][j/CELL]!=WL_STREAM)) break; } if(parts[i].vy>0) @@ -5162,7 +5162,7 @@ killed: parts[i].y += j-y; break; } - if((pmap[j][x]&255)!=t || (bmap[j/CELL][x/CELL] && bmap[j/CELL][x/CELL]!=WL_STREAM)) + if((pmap[j][x]&0xFFF)!=t || (bmap[j/CELL][x/CELL] && bmap[j/CELL][x/CELL]!=WL_STREAM)) { s = 0; break;