summaryrefslogtreecommitdiff
path: root/src/powder.c
diff options
context:
space:
mode:
authorBryan Hoyle <starfoxprime@gmail.com>2011-08-16 22:07:12 (GMT)
committer Bryan Hoyle <starfoxprime@gmail.com>2011-08-16 22:07:12 (GMT)
commit161eb60cfa542a72a76598b3cb99a6b1994d3f48 (patch)
treee1535de4bd4b5493889f21f9b4e1eab40bc27cc9 /src/powder.c
parente2df8e2c16e17222794fbe94dc9b491101cc34df (diff)
downloadpowder-161eb60cfa542a72a76598b3cb99a6b1994d3f48.zip
powder-161eb60cfa542a72a76598b3cb99a6b1994d3f48.tar.gz
Added PGRV and NGRV for positive and negative gravity tools (sortof like air and vac, but with gravity)
Diffstat (limited to 'src/powder.c')
-rw-r--r--src/powder.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/powder.c b/src/powder.c
index 85c31e1..abff116 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -647,7 +647,7 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
int t = tv & 0xFF;
int v = (tv >> 8) & 0xFF;
- if (x<0 || y<0 || x>=XRES || y>=YRES || ((t<0 || t>=PT_NUM)&&t!=SPC_HEAT&&t!=SPC_COOL&&t!=SPC_AIR&&t!=SPC_VACUUM))
+ if (x<0 || y<0 || x>=XRES || y>=YRES || ((t<0 || t>=PT_NUM)&&t!=SPC_HEAT&&t!=SPC_COOL&&t!=SPC_AIR&&t!=SPC_VACUUM&&t!=SPC_PGRV&&t!=SPC_NGRV))
return -1;
if (t>=0 && t<PT_NUM && !ptypes[t].enabled)
return -1;
@@ -709,6 +709,17 @@ inline int create_part(int p, int x, int y, int tv)//the function for creating a
}
return -1;
}
+ if (t==SPC_PGRV)
+ {
+ gravmap[y/CELL][x/CELL] = 5;
+ return -1;
+ }
+ if (t==SPC_NGRV)
+ {
+ gravmap[y/CELL][x/CELL] = -5;
+ return -1;
+ }
+
if (t==PT_SPRK)
{
@@ -2667,7 +2678,7 @@ int create_parts(int x, int y, int rx, int ry, int c)
{
if (wall==r)
{
- if (c == SPC_AIR || c == SPC_HEAT || c == SPC_COOL || c == SPC_VACUUM)
+ if (c == SPC_AIR || c == SPC_HEAT || c == SPC_COOL || c == SPC_VACUUM || c == SPC_PGRV || c == SPC_NGRV)
break;
if (wall == WL_ERASE)
b = 0;
@@ -2752,7 +2763,7 @@ int create_parts(int x, int y, int rx, int ry, int c)
}
//why do these need a special if
- if (c == SPC_AIR || c == SPC_HEAT || c == SPC_COOL || c == SPC_VACUUM)
+ if (c == SPC_AIR || c == SPC_HEAT || c == SPC_COOL || c == SPC_VACUUM || c == SPC_PGRV || c == SPC_NGRV)
{
if (rx==0&&ry==0)
{