summaryrefslogtreecommitdiff
path: root/src/elements
diff options
context:
space:
mode:
authorsavask <savask@yandex.ru>2011-05-26 16:19:40 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2011-06-04 18:12:21 (GMT)
commit7f245483a2683b67ceef6ce8aab3244b63b3888e (patch)
tree4e33d61d4f676135783eff8696c7f9627e8e9d04 /src/elements
parente42e7d019eb58caaab6369747fba872f74ca6293 (diff)
downloadpowder-7f245483a2683b67ceef6ce8aab3244b63b3888e.zip
powder-7f245483a2683b67ceef6ce8aab3244b63b3888e.tar.gz
Some fixes for stick mans.
Diffstat (limited to 'src/elements')
-rw-r--r--src/elements/stkm.c4
-rw-r--r--src/elements/stkm2.c8
2 files changed, 8 insertions, 4 deletions
diff --git a/src/elements/stkm.c b/src/elements/stkm.c
index 9a8a1ff..8b19406 100644
--- a/src/elements/stkm.c
+++ b/src/elements/stkm.c
@@ -192,8 +192,10 @@ int update_STKM(UPDATE_FUNC_ARGS) {
r = pmap[y+ry][x+rx];
if (!r || (r>>8)>=NPART)
r = photons[y+ry][x+rx];
- if (!r || (r>>8)>=NPART)
+
+ if ((!r || (r>>8)>=NPART) && !bmap[(y+ry)/CELL][(x+rx)/CELL])
continue;
+
if (ptypes[r&0xFF].falldown!=0 || (r&0xFF) == PT_NEUT || (r&0xFF) == PT_PHOT)
{
player[2] = r&0xFF; //Current element
diff --git a/src/elements/stkm2.c b/src/elements/stkm2.c
index 4498060..32f8619 100644
--- a/src/elements/stkm2.c
+++ b/src/elements/stkm2.c
@@ -192,8 +192,10 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
r = pmap[y+ry][x+rx];
if (!r || (r>>8)>=NPART)
r = photons[y+ry][x+rx];
- if (!r || (r>>8)>=NPART)
+
+ if ((!r || (r>>8)>=NPART) && !bmap[(y+ry)/CELL][(x+rx)/CELL])
continue;
+
if (ptypes[r&0xFF].falldown!=0 || (r&0xFF) == PT_NEUT || (r&0xFF) == PT_PHOT)
{
player2[2] = r&0xFF; //Current element
@@ -304,7 +306,7 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
r = pmap[(int)(player2[8]+ry)][(int)(player2[7]+0.5)]; //This is to make coding more pleasant :-)
//For left leg
- if (r && (r&0xFF)!=PT_STKM)
+ if (r && (r&0xFF)!=PT_STKM2)
{
if ((r&0xFF)<PT_NUM && (ptypes[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG)) //Liquid checks
{
@@ -329,7 +331,7 @@ int update_STKM2(UPDATE_FUNC_ARGS) {
r = pmap[(int)(player2[16]+ry)][(int)(player2[15]+0.5)];
//For right leg
- if (r && (r&0xFF)!=PT_STKM)
+ if (r && (r&0xFF)!=PT_STKM2)
{
if ((r&0xFF)<PT_NUM && (ptypes[r&0xFF].state == ST_LIQUID || (r&0xFF) == PT_LNTG))
{