Don't heat elements which don't conduct heat

This commit is contained in:
jacksonmj 2011-10-12 23:58:56 +08:00 committed by Simon Robertshaw
parent 2f46dca7c1
commit fc4836e69b
3 changed files with 11 additions and 8 deletions

View File

@ -43,7 +43,7 @@ int update_DEST(UPDATE_FUNC_ARGS) {
} }
else else
{ {
parts[r>>8].temp = restrict_flt(parts[r>>8].temp+10000.0f, MIN_TEMP, MAX_TEMP); if (ptypes[r&0xFF].hconduct) parts[r>>8].temp = restrict_flt(parts[r>>8].temp+10000.0f, MIN_TEMP, MAX_TEMP);
} }
int topv=pv[y/CELL][x/CELL]/9+parts[r>>8].temp/900; int topv=pv[y/CELL][x/CELL]/9+parts[r>>8].temp/900;
if (topv>40.0f) if (topv>40.0f)

View File

@ -35,7 +35,7 @@ int update_EMP(UPDATE_FUNC_ARGS) {
parts[r].ctype==PT_NTCT || parts[r].ctype==PT_INST || parts[r].ctype==PT_SWCH) || t==PT_WIRE || t==PT_SWCH) parts[r].ctype==PT_NTCT || parts[r].ctype==PT_INST || parts[r].ctype==PT_SWCH) || t==PT_WIRE || t==PT_SWCH)
{ {
is_elec=1; is_elec=1;
if (rand()%100==0) if (ptypes[parts[r].type].hconduct && rand()%100==0)
parts[r].temp = restrict_flt(parts[r].temp+3000.0f, MIN_TEMP, MAX_TEMP); parts[r].temp = restrict_flt(parts[r].temp+3000.0f, MIN_TEMP, MAX_TEMP);
if (rand()%80==0) if (rand()%80==0)
part_change_type(r, rx, ry, PT_BREC); part_change_type(r, rx, ry, PT_BREC);

View File

@ -114,12 +114,12 @@ int update_LIGH(UPDATE_FUNC_ARGS)
parts[r>>8].life = 4; parts[r>>8].life = 4;
pv[y/CELL][x/CELL] += powderful/1200; pv[y/CELL][x/CELL] += powderful/1200;
parts[r>>8].temp = restrict_flt(parts[r>>8].temp+powderful/20, MIN_TEMP, MAX_TEMP); if (ptypes[r&0xFF].hconduct) parts[r>>8].temp = restrict_flt(parts[r>>8].temp+powderful/20, MIN_TEMP, MAX_TEMP);
} }
else if ((r&0xFF)!=PT_CLNE&&(r&0xFF)!=PT_THDR&&(r&0xFF)!=PT_SPRK&&(r&0xFF)!=PT_DMND&&(r&0xFF)!=PT_FIRE&&(r&0xFF)!=PT_NEUT&&(r&0xFF)!=PT_PHOT) else if ((r&0xFF)!=PT_CLNE&&(r&0xFF)!=PT_THDR&&(r&0xFF)!=PT_SPRK&&(r&0xFF)!=PT_DMND&&(r&0xFF)!=PT_FIRE&&(r&0xFF)!=PT_NEUT&&(r&0xFF)!=PT_PHOT)
{ {
pv[y/CELL][x/CELL] += powderful/110; pv[y/CELL][x/CELL] += powderful/110;
parts[r>>8].temp = restrict_flt(parts[r>>8].temp+powderful/1.5, MIN_TEMP, MAX_TEMP); if (ptypes[r&0xFF].hconduct) parts[r>>8].temp = restrict_flt(parts[r>>8].temp+powderful/1.5, MIN_TEMP, MAX_TEMP);
} }
if ((r&0xFF)==PT_DEUT || (r&0xFF)==PT_PLUT) if ((r&0xFF)==PT_DEUT || (r&0xFF)==PT_PLUT)
{ {
@ -134,10 +134,13 @@ int update_LIGH(UPDATE_FUNC_ARGS)
} }
} }
} }
if ((r&0xFF)!=PT_CLNE&&(r&0xFF)!=PT_THDR&&(r&0xFF)!=PT_SPRK&&(r&0xFF)!=PT_DMND&&(r&0xFF)!=PT_FIRE&&(r&0xFF)!=PT_NEUT&&(r&0xFF)!=PT_PHOT) if (ptypes[r&0xFF].hconduct)
parts[r>>8].temp = restrict_flt(parts[r>>8].temp+powderful/16, MIN_TEMP, MAX_TEMP); {
else if ((r&0xFF)!=PT_CLNE&&(r&0xFF)!=PT_THDR&&(r&0xFF)!=PT_SPRK&&(r&0xFF)!=PT_DMND&&(r&0xFF)!=PT_FIRE&&(r&0xFF)!=PT_NEUT&&(r&0xFF)!=PT_PHOT)
parts[r>>8].temp = restrict_flt(parts[r>>8].temp+powderful/70, MIN_TEMP, MAX_TEMP); parts[r>>8].temp = restrict_flt(parts[r>>8].temp+powderful/16, MIN_TEMP, MAX_TEMP);
else
parts[r>>8].temp = restrict_flt(parts[r>>8].temp+powderful/70, MIN_TEMP, MAX_TEMP);
}
} }
} }
if (parts[i].tmp2==3) if (parts[i].tmp2==3)