From 799954f38339c2f69ed2f297751b8c30dd57a683 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 25 Jul 2012 17:51:37 +0100 Subject: TPT: Allow stickman head to go through everything 95ca29cc64 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=XRES-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) { -- cgit v0.9.2-21-gd62e