From 79614a97197803c0b8bf9cc9cb5b92047c142f6c Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Wed, 20 Jun 2012 22:40:08 +0100 Subject: [PATCH] Use eval_move(PT_FIGH, ...) when fighters are checking for obstacles Also stop fighters being included in the stacking check --- src/elements/figh.c | 22 +++++++++++----------- src/powder.c | 4 ++-- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/elements/figh.c b/src/elements/figh.c index ce00af744..2234eab35 100644 --- a/src/elements/figh.c +++ b/src/elements/figh.c @@ -23,7 +23,7 @@ int update_FIGH(UPDATE_FUNC_ARGS) parts[i].tmp2 = 0; //0 - stay in place, 1 - seek a stick man - //Set target cords + //Set target coords if (player.spwn && player2.spwn) { if ((pow(player.legs[2]-x, 2) + pow(player.legs[3]-y, 2))<= @@ -68,28 +68,28 @@ int update_FIGH(UPDATE_FUNC_ARGS) else if (tarxlegs[4]-10, figh->legs[5]+6, NULL) - && eval_move(PT_DUST, figh->legs[4]-10, figh->legs[5]+3, NULL))) + if(!(eval_move(PT_FIGH, figh->legs[4]-10, figh->legs[5]+6, NULL) + && eval_move(PT_FIGH, figh->legs[4]-10, figh->legs[5]+3, NULL))) figh->comm = 0x01; else figh->comm = 0x02; - if (!eval_move(PT_DUST, figh->legs[4]-4, figh->legs[5]-1, NULL) - || !eval_move(PT_DUST, figh->legs[12]-4, figh->legs[13]-1, NULL) - || eval_move(PT_DUST, 2*figh->legs[4]-figh->legs[6], figh->legs[5]+5, NULL)) + if (!eval_move(PT_FIGH, figh->legs[4]-4, figh->legs[5]-1, NULL) + || !eval_move(PT_FIGH, figh->legs[12]-4, figh->legs[13]-1, NULL) + || eval_move(PT_FIGH, 2*figh->legs[4]-figh->legs[6], figh->legs[5]+5, NULL)) figh->comm = (int)figh->comm | 0x04; } else { - if (!(eval_move(PT_DUST, figh->legs[12]+10, figh->legs[13]+6, NULL) - && eval_move(PT_DUST, figh->legs[12]+10, figh->legs[13]+3, NULL))) + if (!(eval_move(PT_FIGH, figh->legs[12]+10, figh->legs[13]+6, NULL) + && eval_move(PT_FIGH, figh->legs[12]+10, figh->legs[13]+3, NULL))) figh->comm = 0x02; else figh->comm = 0x01; - if (!eval_move(PT_DUST, figh->legs[4]+4, figh->legs[5]-1, NULL) - || !eval_move(PT_DUST, figh->legs[4]+4, figh->legs[5]-1, NULL) - || eval_move(PT_DUST, 2*figh->legs[12]-figh->legs[14], figh->legs[13]+5, NULL)) + if (!eval_move(PT_FIGH, figh->legs[4]+4, figh->legs[5]-1, NULL) + || !eval_move(PT_FIGH, figh->legs[4]+4, figh->legs[5]-1, NULL) + || eval_move(PT_FIGH, 2*figh->legs[12]-figh->legs[14], figh->legs[13]+5, NULL)) figh->comm = (int)figh->comm | 0x04; } break; diff --git a/src/powder.c b/src/powder.c index fd01dd620..da715f6f0 100644 --- a/src/powder.c +++ b/src/powder.c @@ -2870,8 +2870,8 @@ void update_particles(pixel *vid)//doesn't update the particles themselves, but if (!pmap[y][x] || (t!=PT_INVIS && t!= PT_FILT)) pmap[y][x] = t|(i<<8); // Count number of particles at each location, for excess stacking check - // (does not include energy particles or THDR - currently no limit on stacking those) - if (t!=PT_THDR && t!=PT_EMBR) + // (there are a few exceptions, including energy particles - currently no limit on stacking those) + if (t!=PT_THDR && t!=PT_EMBR && t!=PT_FIGH) pmap_count[y][x]++; } }