summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/powder.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/src/powder.c b/src/powder.c
index b3587cc..817c5f7 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -755,12 +755,15 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
if (t==SPC_HEAT||t==SPC_COOL)
{
- if ((pmap[y][x]&0xFF)!=PT_NONE&&(pmap[y][x]&0xFF)<PT_NUM)
+ int r = pmap[y][x];
+ if (!(r&0xFF))
+ r = photons[y][x];
+ if ((r&0xFF)!=PT_NONE&&(r&0xFF)<PT_NUM)
{
- if (t==SPC_HEAT&&parts[pmap[y][x]>>8].temp<MAX_TEMP)
+ if (t==SPC_HEAT&&parts[r>>8].temp<MAX_TEMP)
{
float heatchange;
- int r = pmap[y][x], fast = ((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL)));
+ int fast = ((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL)));
if ((r&0xFF)==PT_PUMP || (r&0xFF)==PT_GPMP)
heatchange = fast?1.0f:.1f;
else
@@ -768,10 +771,10 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
parts[r>>8].temp = restrict_flt(parts[r>>8].temp + heatchange, MIN_TEMP, MAX_TEMP);
}
- if (t==SPC_COOL&&parts[pmap[y][x]>>8].temp>MIN_TEMP)
+ if (t==SPC_COOL&&parts[r>>8].temp>MIN_TEMP)
{
float heatchange;
- int r = pmap[y][x], fast = ((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL)));
+ int fast = ((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL)));
if ((r&0xFF)==PT_PUMP || (r&0xFF)==PT_GPMP)
heatchange = fast?1.0f:.1f;
else
@@ -779,7 +782,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
parts[r>>8].temp = restrict_flt(parts[r>>8].temp - heatchange, MIN_TEMP, MAX_TEMP);
}
- return pmap[y][x]>>8;
+ return r>>8;
}
else
{