diff options
| author | Jacob1 <jfu614@gmail.com> | 2012-05-24 17:13:28 (GMT) |
|---|---|---|
| committer | Jacob1 <jfu614@gmail.com> | 2012-05-24 17:13:28 (GMT) |
| commit | 9a179651ee9826f4c0b7df6c57aa75d8101baf5e (patch) | |
| tree | c0c34f852c33ecee5d81669082517eec53248a7b /src/powder.c | |
| parent | bdc94208d22dd65d5796264b62d275114489b35e (diff) | |
| download | powder-9a179651ee9826f4c0b7df6c57aa75d8101baf5e.zip powder-9a179651ee9826f4c0b7df6c57aa75d8101baf5e.tar.gz | |
energy type particles automatically go into photons, not pmap
Diffstat (limited to 'src/powder.c')
| -rw-r--r-- | src/powder.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/src/powder.c b/src/powder.c index e3e8c18..a1187b1 100644 --- a/src/powder.c +++ b/src/powder.c @@ -176,6 +176,7 @@ void init_can_move() //whol eats anar can_move[PT_ANAR][PT_WHOL] = 1; can_move[PT_ANAR][PT_NWHL] = 1; + can_move[PT_THDR][PT_THDR] = 2; } /* @@ -257,7 +258,7 @@ int try_move(int i, int x, int y, int nx, int ny) if (!e) //if no movement { - if (parts[i].type!=PT_NEUT && parts[i].type!=PT_PHOT && parts[i].type!=PT_ELEC) + if (!(ptypes[parts[i].type].properties & TYPE_ENERGY)) return 0; if (!legacy_enable && parts[i].type==PT_PHOT && r)//PHOT heat conduction { @@ -271,7 +272,7 @@ int try_move(int i, int x, int y, int nx, int ny) if (!parts[r>>8].ctype) parts[r>>8].ctype = parts[i].type; } - if ((r&0xFF)==PT_PRTI && (parts[i].type==PT_PHOT || parts[i].type==PT_NEUT || parts[i].type==PT_ELEC)) + if ((r&0xFF)==PT_PRTI && (ptypes[parts[i].type].properties & TYPE_ENERGY)) { int nnx, count; for (count=0; count<8; count++) @@ -427,7 +428,7 @@ int do_move(int i, int x, int y, float nxf, float nyf) kill_part(i); return -1; } - if (t==PT_PHOT||t==PT_NEUT||t==PT_ELEC) + if (ptypes[t].properties & TYPE_ENERGY) photons[ny][nx] = t|(i<<8); else if (t) pmap[ny][nx] = t|(i<<8); @@ -678,7 +679,7 @@ inline void part_change_type(int i, int x, int y, int t)//changes the type of pa } parts[i].type = t; - if (t==PT_PHOT || t==PT_NEUT || t==PT_ELEC) + if (ptypes[t].properties & TYPE_ENERGY) { photons[y][x] = t|(i<<8); if ((pmap[y][x]>>8)==i) @@ -845,7 +846,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a } return -1; } - if (photons[y][x] && (t==PT_PHOT||t==PT_NEUT||t==PT_ELEC)) + if (photons[y][x] && (ptypes[t].properties & TYPE_ENERGY)) return -1; if (pfree == -1) return -1; @@ -1106,7 +1107,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a if (t==PT_BIZR||t==PT_BIZRG||t==PT_BIZRS) parts[i].ctype = 0x47FFFF; //and finally set the pmap/photon maps to the newly created particle - if (t==PT_PHOT||t==PT_NEUT||t==PT_ELEC) + if (ptypes[t].properties & TYPE_ENERGY) photons[y][x] = t|(i<<8); else if (t!=PT_STKM && t!=PT_STKM2 && t!=PT_FIGH) pmap[y][x] = t|(i<<8); @@ -2351,7 +2352,7 @@ killed: stagnant = parts[i].flags & FLAG_STAGNANT; parts[i].flags &= ~FLAG_STAGNANT; - if ((t==PT_PHOT||t==PT_NEUT||t==PT_ELEC)) { + if (ptypes[t].properties & TYPE_ENERGY) { if (t == PT_PHOT) { if (parts[i].flags&FLAG_SKIPMOVE) { @@ -2752,7 +2753,7 @@ void update_particles(pixel *vid)//doesn't update the particles themselves, but y = (int)(parts[i].y+0.5f); if (x>=0 && y>=0 && x<XRES && y<YRES) { - if (t==PT_PHOT||t==PT_NEUT||t==PT_ELEC) + if (ptypes[t].properties & TYPE_ENERGY) photons[y][x] = t|(i<<8); else pmap[y][x] = t|(i<<8); |
