summaryrefslogtreecommitdiff
path: root/src/powder.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-06-01 19:18:19 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-06-01 19:18:19 (GMT)
commitc003fee63ee63d5bc5194349fe262db101c17e1f (patch)
treea5eb45fc8d1c49b0764ae6b9c4e9341162b0c7ef /src/powder.c
parent3d600c69558b4b3e3f05b860531942f1ea2cd1c1 (diff)
downloadpowder-c003fee63ee63d5bc5194349fe262db101c17e1f.zip
powder-c003fee63ee63d5bc5194349fe262db101c17e1f.tar.gz
Ambient heat (disabled by default)
Diffstat (limited to 'src/powder.c')
-rw-r--r--src/powder.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/powder.c b/src/powder.c
index cdff223..c7354bc 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -1614,6 +1614,19 @@ void update_particles_i(pixel *vid, int start, int inc)
h_count = 0;
if (t&&(t!=PT_HSWC||parts[i].life==10)&&ptypes[t].hconduct>(rand()%250))
{
+ if (aheat_enable)
+ {
+ if (hv[y/CELL][x/CELL] < parts[i].temp)
+ {
+ hv[y/CELL][x/CELL] = hv[y/CELL][x/CELL] + parts[i].temp*0.04;
+ parts[i].temp = parts[i].temp - hv[y/CELL][x/CELL]*0.04;
+ }
+ else
+ {
+ hv[y/CELL][x/CELL] = hv[y/CELL][x/CELL] - parts[i].temp*0.04;
+ parts[i].temp = parts[i].temp + hv[y/CELL][x/CELL]*0.04;
+ }
+ }
for (j=0; j<8; j++)
{
surround_hconduct[j] = i;