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/elements | |
| 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/elements')
| -rw-r--r-- | src/elements/fwrk.c | 20 | ||||
| -rw-r--r-- | src/elements/phot.c | 1 | ||||
| -rw-r--r-- | src/elements/sprk.c | 4 |
3 files changed, 13 insertions, 12 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) |
