summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-10-12 15:58:56 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-10-13 16:33:21 (GMT)
commitfc4836e69b14b413315deb67c349b7e2badb9c2b (patch)
tree130445f9f5c6289dd32fc9c00bcd936af1108e56 /src/elements
parent2f46dca7c1d0016957dfd88831f453f06e080fef (diff)
downloadpowder-fc4836e69b14b413315deb67c349b7e2badb9c2b.zip
powder-fc4836e69b14b413315deb67c349b7e2badb9c2b.tar.gz
Don't heat elements which don't conduct heat
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/dest.c2
-rw-r--r--src/elements/emp.c2
-rw-r--r--src/elements/ligh.c15
3 files changed, 11 insertions, 8 deletions
diff --git a/src/elements/dest.c b/src/elements/dest.c
index a50dfaa..17ea2fe 100644
--- a/src/elements/dest.c
+++ b/src/elements/dest.c
@@ -43,7 +43,7 @@ int update_DEST(UPDATE_FUNC_ARGS) {
}
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;
if (topv>40.0f)
diff --git a/src/elements/emp.c b/src/elements/emp.c
index 96d1a6d..b90fa86 100644
--- a/src/elements/emp.c
+++ b/src/elements/emp.c
@@ -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)
{
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);
if (rand()%80==0)
part_change_type(r, rx, ry, PT_BREC);
diff --git a/src/elements/ligh.c b/src/elements/ligh.c
index f3eb316..1d38a6d 100644
--- a/src/elements/ligh.c
+++ b/src/elements/ligh.c
@@ -114,12 +114,12 @@ int update_LIGH(UPDATE_FUNC_ARGS)
parts[r>>8].life = 4;
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)
{
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)
{
@@ -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)
- 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 (ptypes[r&0xFF].hconduct)
+ {
+ 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/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)