TPT: Use eval_move(PT_FIGH, ...) when fighters are checking for obstacles 79614a9719

This commit is contained in:
Simon Robertshaw
2012-07-25 17:21:13 +01:00
parent 5031291bf6
commit 811c2cb26b
2 changed files with 12 additions and 11 deletions

View File

@@ -4243,7 +4243,8 @@ void Simulation::update_particles()//doesn't update the particles themselves, bu
// To make particles collide correctly when inside these elements, these elements must not overwrite an existing pmap entry from particles inside them
if (!pmap[y][x] || (t!=PT_INVIS && t!= PT_FILT))
pmap[y][x] = t|(i<<8);
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]++;
}
}

View File

@@ -101,28 +101,28 @@ int Element_FIGH::update(UPDATE_FUNC_ARGS)
else
if (tarx<x)
{
if(!(sim->eval_move(PT_DUST, figh->legs[4]-10, figh->legs[5]+6, NULL)
&& sim->eval_move(PT_DUST, figh->legs[4]-10, figh->legs[5]+3, NULL)))
if(!(sim->eval_move(PT_FIGH, figh->legs[4]-10, figh->legs[5]+6, NULL)
&& sim->eval_move(PT_FIGH, figh->legs[4]-10, figh->legs[5]+3, NULL)))
figh->comm = 0x01;
else
figh->comm = 0x02;
if (!sim->eval_move(PT_DUST, figh->legs[4]-4, figh->legs[5]-1, NULL)
|| !sim->eval_move(PT_DUST, figh->legs[12]-4, figh->legs[13]-1, NULL)
|| sim->eval_move(PT_DUST, 2*figh->legs[4]-figh->legs[6], figh->legs[5]+5, NULL))
if (!sim->eval_move(PT_FIGH, figh->legs[4]-4, figh->legs[5]-1, NULL)
|| !sim->eval_move(PT_FIGH, figh->legs[12]-4, figh->legs[13]-1, NULL)
|| sim->eval_move(PT_FIGH, 2*figh->legs[4]-figh->legs[6], figh->legs[5]+5, NULL))
figh->comm = (int)figh->comm | 0x04;
}
else
{
if (!(sim->eval_move(PT_DUST, figh->legs[12]+10, figh->legs[13]+6, NULL)
&& sim->eval_move(PT_DUST, figh->legs[12]+10, figh->legs[13]+3, NULL)))
if (!(sim->eval_move(PT_FIGH, figh->legs[12]+10, figh->legs[13]+6, NULL)
&& sim->eval_move(PT_FIGH, figh->legs[12]+10, figh->legs[13]+3, NULL)))
figh->comm = 0x02;
else
figh->comm = 0x01;
if (!sim->eval_move(PT_DUST, figh->legs[4]+4, figh->legs[5]-1, NULL)
|| !sim->eval_move(PT_DUST, figh->legs[4]+4, figh->legs[5]-1, NULL)
|| sim->eval_move(PT_DUST, 2*figh->legs[12]-figh->legs[14], figh->legs[13]+5, NULL))
if (!sim->eval_move(PT_FIGH, figh->legs[4]+4, figh->legs[5]-1, NULL)
|| !sim->eval_move(PT_FIGH, figh->legs[4]+4, figh->legs[5]-1, NULL)
|| sim->eval_move(PT_FIGH, 2*figh->legs[12]-figh->legs[14], figh->legs[13]+5, NULL))
figh->comm = (int)figh->comm | 0x04;
}
break;