summaryrefslogtreecommitdiff
path: root/src/powder.c
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2011-06-28 12:58:16 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-06-28 12:58:16 (GMT)
commit437f13f42458052b7289d7cdc4c36aa3153a076e (patch)
treeaa8d66647f20c55c25c7ec818bc97f1a524363f4 /src/powder.c
parent3fe82bf525584bfe333013da218b530fd2f277f2 (diff)
downloadpowder-437f13f42458052b7289d7cdc4c36aa3153a076e.zip
powder-437f13f42458052b7289d7cdc4c36aa3153a076e.tar.gz
Powered Breakable clone, Gravity Pump, New menu section for powered elements (needs icon)
Diffstat (limited to 'src/powder.c')
-rw-r--r--src/powder.c17
1 files changed, 13 insertions, 4 deletions
diff --git a/src/powder.c b/src/powder.c
index c048e97..5b81890 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -215,7 +215,7 @@ int try_move(int i, int x, int y, int nx, int ny)
if ((r & 0xFF) < PT_NUM && ptypes[r&0xFF].hconduct)
parts[i].temp = parts[r>>8].temp = restrict_flt((parts[r>>8].temp+parts[i].temp)/2, MIN_TEMP, MAX_TEMP);
}
- if (parts[i].type==PT_NEUT && ((r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || (r&0xFF)==PT_BCLN)) {
+ if (parts[i].type==PT_NEUT && ((r&0xFF)==PT_CLNE || (r&0xFF)==PT_PCLN || (r&0xFF)==PT_BCLN || (r&0xFF)==PT_PBCN)) {
if (!parts[r>>8].ctype)
parts[r>>8].ctype = PT_NEUT;
}
@@ -652,7 +652,7 @@ inline int create_part(int p, int x, int y, int t)//the function for creating a
{
if (t==SPC_HEAT&&parts[pmap[y][x]>>8].temp<MAX_TEMP)
{
- if ((pmap[y][x]&0xFF)==PT_PUMP) {
+ if ((pmap[y][x]&0xFF)==PT_PUMP || (pmap[y][x]&0xFF)==PT_GPMP) {
parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 0.1f, MIN_TEMP, MAX_TEMP);
} else if ((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL))) {
parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp + 50.0f, MIN_TEMP, MAX_TEMP);
@@ -662,7 +662,7 @@ inline int create_part(int p, int x, int y, int t)//the function for creating a
}
if (t==SPC_COOL&&parts[pmap[y][x]>>8].temp>MIN_TEMP)
{
- if ((pmap[y][x]&0xFF)==PT_PUMP) {
+ if ((pmap[y][x]&0xFF)==PT_PUMP || (pmap[y][x]&0xFF)==PT_GPMP) {
parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 0.1f, MIN_TEMP, MAX_TEMP);
} else if ((sdl_mod & (KMOD_SHIFT)) && (sdl_mod & (KMOD_CTRL))) {
parts[pmap[y][x]>>8].temp = restrict_flt(parts[pmap[y][x]>>8].temp - 50.0f, MIN_TEMP, MAX_TEMP);
@@ -741,7 +741,16 @@ inline int create_part(int p, int x, int y, int t)//the function for creating a
{
if (pmap[y][x])
{
- if (((pmap[y][x]&0xFF)==PT_CLNE||(pmap[y][x]&0xFF)==PT_BCLN||((pmap[y][x]&0xFF)==PT_PCLN&&t!=PT_PSCN&&t!=PT_NSCN))&&(t!=PT_CLNE&&t!=PT_PCLN&&t!=PT_BCLN&&t!=PT_STKM&&t!=PT_STKM2))
+ if ((
+ (pmap[y][x]&0xFF)==PT_CLNE||
+ (pmap[y][x]&0xFF)==PT_BCLN||
+ ((pmap[y][x]&0xFF)==PT_PCLN&&t!=PT_PSCN&&t!=PT_NSCN)||
+ ((pmap[y][x]&0xFF)==PT_PBCN&&t!=PT_PSCN&&t!=PT_NSCN)
+ )&&(
+ t!=PT_CLNE&&t!=PT_PCLN&&
+ t!=PT_BCLN&&t!=PT_STKM&&
+ t!=PT_STKM2&&t!=PT_PBCN)
+ )
{
parts[pmap[y][x]>>8].ctype = t;
}