summaryrefslogtreecommitdiff
path: root/src/powder.c
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2011-05-27 14:43:30 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-05-28 10:51:57 (GMT)
commit420f8e7442077aab83b92270bef22f123113af73 (patch)
tree0a047807e2092c7c4481bbca77ec0d973d6a8fc7 /src/powder.c
parent6e9cbfdb4a1cec1ab1a400bc5f6c30ecb61c84b3 (diff)
downloadpowder-420f8e7442077aab83b92270bef22f123113af73.zip
powder-420f8e7442077aab83b92270bef22f123113af73.tar.gz
Make NBHL/NWHL eat things in the same way as BHOL/WHOL
Also make ANAR move opposite to Newtonian gravity
Diffstat (limited to 'src/powder.c')
-rw-r--r--src/powder.c16
1 files changed, 11 insertions, 5 deletions
diff --git a/src/powder.c b/src/powder.c
index 1fc094d..544430b 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -76,10 +76,10 @@ int eval_move(int pt, int nx, int ny, unsigned *rr)
if (rr)
*rr = r;
- if ((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL)
+ if ((r&0xFF)==PT_VOID || (r&0xFF)==PT_BHOL || (r&0xFF)==PT_NBHL)
return 1;
- if ((r&0xFF)==PT_WHOL && pt==PT_ANAR)
+ if (((r&0xFF)==PT_WHOL||(r&0xFF)==PT_NWHL) && pt==PT_ANAR)
return 1;
if (pt==PT_SPRK)//spark shouldn't move
@@ -255,7 +255,7 @@ int try_move(int i, int x, int y, int nx, int ny)
parts[i].type=PT_NONE;
return 0;
}
- if ((r&0xFF)==PT_BHOL) //this is where blackhole eats particles
+ if ((r&0xFF)==PT_BHOL || (r&0xFF)==PT_NBHL) //this is where blackhole eats particles
{
if (parts[i].type == PT_STKM)
{
@@ -275,7 +275,7 @@ int try_move(int i, int x, int y, int nx, int ny)
return 0;
}
- if ((r&0xFF)==PT_WHOL && parts[i].type==PT_ANAR) //whitehole eats anar
+ if (((r&0xFF)==PT_WHOL||(r&0xFF)==PT_NWHL) && parts[i].type==PT_ANAR) //whitehole eats anar
{
parts[i].type=PT_NONE;
if (!legacy_enable)
@@ -1525,7 +1525,13 @@ void update_particles_i(pixel *vid, int start, int inc)
pGravY = ptypes[t].gravity * ((float)(y - YCNTR) / pGravD);
}
//Get some gravity from the gravity map
- if(!(ptypes[t].properties & TYPE_SOLID))
+ if (t==PT_ANAR)
+ {
+ // perhaps we should have a ptypes variable for this
+ pGravX -= gravx[y/CELL][x/CELL];
+ pGravY -= gravy[y/CELL][x/CELL];
+ }
+ else if(!(ptypes[t].properties & TYPE_SOLID))
{
pGravX += gravx[y/CELL][x/CELL];
pGravY += gravy[y/CELL][x/CELL];