diff options
| author | jacksonmj <mj-pt@jacksonmj.co.uk> | 2012-01-15 13:54:31 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-01-25 13:33:20 (GMT) |
| commit | bdf277e68720cd09551a24c9d7f39d3f7d80e2d3 (patch) | |
| tree | 5733a8d7e0cd7e5ebbdebf412c2da5ba4c0f9785 /src/powder.c | |
| parent | 16ea042bab854bbb1b0d97621ed93af1744488c5 (diff) | |
| download | powder-bdf277e68720cd09551a24c9d7f39d3f7d80e2d3.zip powder-bdf277e68720cd09551a24c9d7f39d3f7d80e2d3.tar.gz | |
Implement PROP_NEUTABSORB
Diffstat (limited to 'src/powder.c')
| -rw-r--r-- | src/powder.c | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/powder.c b/src/powder.c index 9267397..d2e36b9 100644 --- a/src/powder.c +++ b/src/powder.c @@ -94,6 +94,8 @@ void init_can_move() if (ptypes[t].weight <= ptypes[rt].weight) can_move[t][rt] = 0; if (t==PT_NEUT && ptypes[rt].properties&PROP_NEUTPASS) can_move[t][rt] = 2; + if (t==PT_NEUT && ptypes[rt].properties&PROP_NEUTABSORB) + can_move[t][rt] = 1; if (t==PT_NEUT && ptypes[rt].properties&PROP_NEUTPENETRATE) can_move[t][rt] = 1; if (ptypes[t].properties&PROP_NEUTPENETRATE && rt==PT_NEUT) @@ -313,6 +315,11 @@ int try_move(int i, int x, int y, int nx, int ny) } //else e=1 , we are trying to swap the particles, return 0 no swap/move, 1 is still overlap/move, because the swap takes place later + if (parts[i].type==PT_NEUT && (ptypes[r&0xFF].properties&PROP_NEUTABSORB)) + { + parts[i].type=PT_NONE; + return 0; + } if ((r&0xFF)==PT_VOID || (r&0xFF)==PT_PVOD) //this is where void eats particles { if (parts[i].type == PT_STKM) |
