diff options
| author | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-25 16:51:37 (GMT) |
|---|---|---|
| committer | Simon Robertshaw <simon@hardwired.org.uk> | 2012-07-25 16:51:37 (GMT) |
| commit | 799954f38339c2f69ed2f297751b8c30dd57a683 (patch) | |
| tree | b384f2cb0a9f4235423587fb04de444f9cd25ad7 /src/simulation/Simulation.cpp | |
| parent | 7859cc839c6ee33e5a4bc6946f3995dea2282413 (diff) | |
| download | powder-799954f38339c2f69ed2f297751b8c30dd57a683.zip powder-799954f38339c2f69ed2f297751b8c30dd57a683.tar.gz | |
TPT: Allow stickman head to go through everything 95ca29cc64
Diffstat (limited to 'src/simulation/Simulation.cpp')
| -rw-r--r-- | src/simulation/Simulation.cpp | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index d59d940..defe436 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -3840,7 +3840,31 @@ killed: stagnant = parts[i].flags & FLAG_STAGNANT; parts[i].flags &= ~FLAG_STAGNANT; - if (elements[t].Properties & TYPE_ENERGY) { + if (t==PT_STKM || t==PT_STKM2 || t==PT_FIGH) + { + int nx, ny; + //head movement, let head pass through anything + parts[i].x += parts[i].vx; + parts[i].y += parts[i].vy; + nx = (int)((float)parts[i].x+0.5f); + ny = (int)((float)parts[i].y+0.5f); + if (ny!=y || nx!=x) + { + if ((pmap[y][x]>>8)==i) pmap[y][x] = 0; + else if ((photons[y][x]>>8)==i) photons[y][x] = 0; + if (nx<CELL || nx>=XRES-CELL || ny<CELL || ny>=YRES-CELL) + { + kill_part(i); + continue; + } + if (elements[t].Properties & TYPE_ENERGY) + photons[ny][nx] = t|(i<<8); + else if (t) + pmap[ny][nx] = t|(i<<8); + } + } + else if (elements[t].Properties & TYPE_ENERGY) + { if (t == PT_PHOT) { if (parts[i].flags&FLAG_SKIPMOVE) { |
