summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjacksonmj <mj-pt@jacksonmj.co.uk>2012-06-22 23:03:50 (GMT)
committer jacksonmj <mj-pt@jacksonmj.co.uk>2012-06-22 23:03:50 (GMT)
commit95ca29cc645e106586c6c4e0605cd703a6d77b6e (patch)
treecde73b4c80cf845c5712114b30ee41158a8e55e5 /src
parent31a61d08883801797c2f860057f23d159800010c (diff)
downloadpowder-95ca29cc645e106586c6c4e0605cd703a6d77b6e.zip
powder-95ca29cc645e106586c6c4e0605cd703a6d77b6e.tar.gz
Allow stickman head to go through everything
Diffstat (limited to 'src')
-rw-r--r--src/powder.c26
1 files changed, 25 insertions, 1 deletions
diff --git a/src/powder.c b/src/powder.c
index d55c9bd..f6f1e8c 100644
--- a/src/powder.c
+++ b/src/powder.c
@@ -2481,7 +2481,31 @@ killed:
stagnant = parts[i].flags & FLAG_STAGNANT;
parts[i].flags &= ~FLAG_STAGNANT;
- if (ptypes[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 (ptypes[t].properties & TYPE_ENERGY)
+ photons[ny][nx] = t|(i<<8);
+ else if (t)
+ pmap[ny][nx] = t|(i<<8);
+ }
+ }
+ else if (ptypes[t].properties & TYPE_ENERGY)
+ {
if (t == PT_PHOT) {
if (parts[i].flags&FLAG_SKIPMOVE)
{