diff options
| author | jacksonmj <jacksonmj@jacksonmj.none> | 2011-02-02 17:37:59 (GMT) |
|---|---|---|
| committer | jacksonmj <jacksonmj@jacksonmj.none> | 2011-02-02 17:49:56 (GMT) |
| commit | 5b1210714d3909139886cc7f8a72291580fc0eeb (patch) | |
| tree | 25ef9d98fc12239901e46054814fb9a77caf5a73 /src | |
| parent | 77bcac1a5628aecdf8e4c1968106e3bed86890ab (diff) | |
| download | powder-5b1210714d3909139886cc7f8a72291580fc0eeb.zip powder-5b1210714d3909139886cc7f8a72291580fc0eeb.tar.gz | |
More fixes
Fix PHOT and FWRK.
Fix QRTZ conductivity (broken by removing PROP_CONDUCTS)
Add some things lost during rewrite: NTCT/PTCT not heated if INSL in the way;
boiling point varies with pressure.
Diffstat (limited to 'src')
| -rw-r--r-- | src/elements/fwrk.c | 20 | ||||
| -rw-r--r-- | src/elements/phot.c | 1 | ||||
| -rw-r--r-- | src/elements/sprk.c | 4 | ||||
| -rw-r--r-- | src/powder.c | 14 |
4 files changed, 24 insertions, 15 deletions
diff --git a/src/elements/fwrk.c b/src/elements/fwrk.c index def28e4..06390c5 100644 --- a/src/elements/fwrk.c +++ b/src/elements/fwrk.c @@ -7,9 +7,9 @@ int update_FWRK(UPDATE_FUNC_ARGS) { np = create_part(-1, x , y-1 , PT_FWRK); if (np!=-1) { - parts[r>>8].vy = rand()%8-22; - parts[r>>8].vx = rand()%20-rand()%20; - parts[r>>8].life=rand()%15+25; + parts[np].vy = rand()%8-22; + parts[np].vx = rand()%20-rand()%20; + parts[np].life=rand()%15+25; kill_part(i); return 1; } @@ -33,13 +33,13 @@ int update_FWRK(UPDATE_FUNC_ARGS) { pv[y/CELL][x/CELL] += 2.00f*CFDS; if (np!=-1) { - parts[r>>8].vy = -(rand()%10-1); - parts[r>>8].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; - parts[r>>8].life= rand()%37+18; - parts[r>>8].tmp=q; - parts[r>>8].flags=w; - parts[r>>8].ctype=e; - parts[r>>8].temp= rand()%20+6000; + parts[np].vy = -(rand()%10-1); + parts[np].vx = ((rand()%2)*2-1)*rand()%(5+5)+(parts[i].vx)*2 ; + parts[np].life= rand()%37+18; + parts[np].tmp=q; + parts[np].flags=w; + parts[np].ctype=e; + parts[np].temp= rand()%20+6000; } } } diff --git a/src/elements/phot.c b/src/elements/phot.c index 11585f9..59e9cd8 100644 --- a/src/elements/phot.c +++ b/src/elements/phot.c @@ -7,6 +7,7 @@ int update_PHOT(UPDATE_FUNC_ARGS) { for (rx=-1; rx<2; rx++) for (ry=-1; ry<2; ry++) if (x+rx>=0 && y+ry>0 && x+rx<XRES && y+ry<YRES && (rx || ry)) { + r = pmap[x+rx][y+ry]; if ((r>>8)>=NPART || !r) continue; if ((r&0xFF)==PT_ISOZ && 5>(rand()%2000)) diff --git a/src/elements/sprk.c b/src/elements/sprk.c index ddac968..39f7497 100644 --- a/src/elements/sprk.c +++ b/src/elements/sprk.c @@ -97,12 +97,12 @@ int update_SPRK(UPDATE_FUNC_ARGS) { // ct = spark from material, rt = spark to material. Make conduct_sprk = 0 if conduction not allowed if (pavg == PT_INSL) conduct_sprk = 0; - if (!(ptypes[rt].properties&PROP_CONDUCTS||rt==PT_INST)) conduct_sprk = 0; + if (!(ptypes[rt].properties&PROP_CONDUCTS||rt==PT_INST||rt==PT_QRTZ)) conduct_sprk = 0; if (abs(rx)+abs(ry)>=4 &&ct!=PT_SWCH&&rt!=PT_SWCH) conduct_sprk = 0; - if (ct==PT_METL && (rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR||(rt==PT_SPRK&&(parts[r>>8].ctype==PT_NTCT||parts[r>>8].ctype==PT_PTCT)))) + if (ct==PT_METL && (rt==PT_NTCT||rt==PT_PTCT||rt==PT_INWR||(rt==PT_SPRK&&(parts[r>>8].ctype==PT_NTCT||parts[r>>8].ctype==PT_PTCT))) && pavg!=PT_INSL) { parts[r>>8].temp = 473.0f; if (rt==PT_NTCT||rt==PT_PTCT) diff --git a/src/powder.c b/src/powder.c index f8a5d3d..b9495a7 100644 --- a/src/powder.c +++ b/src/powder.c @@ -1127,7 +1127,7 @@ int nearest_part(int ci, int t) void update_particles_i(pixel *vid, int start, int inc) { int i, j, x, y, t, nx, ny, r, surround_space, s, lt, rt, nt, nnx, nny, q, golnum, goldelete, z, neighbors; - float mv, dx, dy, ix, iy, lx, ly, nrx, nry, dp; + float mv, dx, dy, ix, iy, lx, ly, nrx, nry, dp, ctemph, ctempl; int fin_x, fin_y, clear_x, clear_y; float fin_xf, fin_yf, clear_xf, clear_yf; float nn, ct1, ct2, swappage; @@ -1522,8 +1522,16 @@ void update_particles_i(pixel *vid, int start, int inc) parts[surround_hconduct[j]].temp = pt; } + ctemph = ctempl = pt; + // change boiling point with pressure + if ((ptypes[t].state==ST_LIQUID && ptransitions[t].tht>-1 && ptransitions[t].tht<PT_NUM && ptypes[ptransitions[t].tht].state==ST_GAS) + || t==PT_LNTG || t==PT_SLTW) + ctemph -= 2.0f*pv[y/CELL][x/CELL]; + else if ((ptypes[t].state==ST_GAS && ptransitions[t].tlt>-1 && ptransitions[t].tlt<PT_NUM && ptypes[ptransitions[t].tlt].state==ST_LIQUID) + || t==PT_WTRV) + ctempl -= 2.0f*pv[y/CELL][x/CELL]; s = 1; - if (pt>ptransitions[t].thv&&ptransitions[t].tht>-1) { + if (ctemph>ptransitions[t].thv&&ptransitions[t].tht>-1) { // particle type change due to high temperature if (ptransitions[t].tht!=PT_NUM) t = ptransitions[t].tht; @@ -1544,7 +1552,7 @@ void update_particles_i(pixel *vid, int start, int inc) else t = PT_WTRV; } else s = 0; - } else if (pt<ptransitions[t].tlv&&ptransitions[t].tlt>-1) { + } else if (ctempl<ptransitions[t].tlv&&ptransitions[t].tlt>-1) { // particle type change due to low temperature if (ptransitions[t].tlt!=PT_NUM) t = ptransitions[t].tlt; |
