diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-17 15:55:43 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-04-17 15:55:43 (GMT) |
| commit | 75f62127518895ae9acddfd2644a67ab8796253c (patch) | |
| tree | 2c734151892dd53bc416b945aa049da01968f83a /src/simulation/Simulation.cpp | |
| parent | db1ffd3208808da53750348068151f46c5ef3bb5 (diff) | |
| download | powder-75f62127518895ae9acddfd2644a67ab8796253c.zip powder-75f62127518895ae9acddfd2644a67ab8796253c.tar.gz | |
TPT: Another change to the eval_move check in create_part eaf2af6d40
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 1fc99ed..ab4a852 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -1845,7 +1845,11 @@ int Simulation::create_part(int p, int x, int y, int tv)//the function for creat return -1; if (p==-1)//creating from anything but brush { - if (pmap[y][x] || (bmap[y/CELL][x/CELL] && eval_move(t, x, y, NULL)!=2)) + // If there is a particle, only allow creation if the new particle can occupy the same space as the existing particle + // If there isn't a particle but there is a wall, check whether the new particle is allowed to be in it + // (not "!=2" for wall check because eval_move returns 1 for moving into empty space) + // If there's no particle and no wall, assume creation is allowed + if (pmap[y][x] ? (eval_move(t, x, y, NULL)!=2) : (bmap[y/CELL][x/CELL] && eval_move(t, x, y, NULL)==0)) { if ((pmap[y][x]&0xFF)!=PT_SPAWN&&(pmap[y][x]&0xFF)!=PT_SPAWN2) { |
