diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-17 15:04:48 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-17 15:04:48 (GMT) |
| commit | 25ce83d5bff3566368f44501cd674a93b1e286e9 (patch) | |
| tree | 483706f21201a90977180ed634f9f24f5602e56f /src/simulation/Simulation.cpp | |
| parent | c261030cef6f63110fecf00aa2d2a22bbb953690 (diff) | |
| download | powder-25ce83d5bff3566368f44501cd674a93b1e286e9.zip powder-25ce83d5bff3566368f44501cd674a93b1e286e9.tar.gz | |
TPT: Implement PROP_NEUTABSORB bdf277e687
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index c266e22..3d0ab0e 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -1126,6 +1126,8 @@ void Simulation::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) @@ -1345,6 +1347,11 @@ int Simulation::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) |
