Use eval_move(PT_FIGH, ...) when fighters are checking for obstacles

Also stop fighters being included in the stacking check
This commit is contained in:
jacksonmj 2012-06-20 22:40:08 +01:00
parent fed8b7b2cc
commit 79614a9719
2 changed files with 13 additions and 13 deletions

View File

@ -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 (tarx<x)
{
if(!(eval_move(PT_DUST, figh->legs[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;

View File

@ -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]++;
}
}