mirror of
https://github.com/The-Powder-Toy/The-Powder-Toy.git
synced 2025-08-13 11:54:04 +02:00
TPT: Use eval_move(PT_FIGH, ...) when fighters are checking for obstacles 79614a9719
This commit is contained in:
@@ -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
|
// 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))
|
if (!pmap[y][x] || (t!=PT_INVIS && t!= PT_FILT))
|
||||||
pmap[y][x] = t|(i<<8);
|
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]++;
|
pmap_count[y][x]++;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -101,28 +101,28 @@ int Element_FIGH::update(UPDATE_FUNC_ARGS)
|
|||||||
else
|
else
|
||||||
if (tarx<x)
|
if (tarx<x)
|
||||||
{
|
{
|
||||||
if(!(sim->eval_move(PT_DUST, figh->legs[4]-10, figh->legs[5]+6, NULL)
|
if(!(sim->eval_move(PT_FIGH, figh->legs[4]-10, figh->legs[5]+6, NULL)
|
||||||
&& sim->eval_move(PT_DUST, figh->legs[4]-10, figh->legs[5]+3, NULL)))
|
&& sim->eval_move(PT_FIGH, figh->legs[4]-10, figh->legs[5]+3, NULL)))
|
||||||
figh->comm = 0x01;
|
figh->comm = 0x01;
|
||||||
else
|
else
|
||||||
figh->comm = 0x02;
|
figh->comm = 0x02;
|
||||||
|
|
||||||
if (!sim->eval_move(PT_DUST, figh->legs[4]-4, figh->legs[5]-1, NULL)
|
if (!sim->eval_move(PT_FIGH, 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_FIGH, 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))
|
|| sim->eval_move(PT_FIGH, 2*figh->legs[4]-figh->legs[6], figh->legs[5]+5, NULL))
|
||||||
figh->comm = (int)figh->comm | 0x04;
|
figh->comm = (int)figh->comm | 0x04;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
if (!(sim->eval_move(PT_DUST, figh->legs[12]+10, figh->legs[13]+6, NULL)
|
if (!(sim->eval_move(PT_FIGH, figh->legs[12]+10, figh->legs[13]+6, NULL)
|
||||||
&& sim->eval_move(PT_DUST, figh->legs[12]+10, figh->legs[13]+3, NULL)))
|
&& sim->eval_move(PT_FIGH, figh->legs[12]+10, figh->legs[13]+3, NULL)))
|
||||||
figh->comm = 0x02;
|
figh->comm = 0x02;
|
||||||
else
|
else
|
||||||
figh->comm = 0x01;
|
figh->comm = 0x01;
|
||||||
|
|
||||||
if (!sim->eval_move(PT_DUST, figh->legs[4]+4, figh->legs[5]-1, NULL)
|
if (!sim->eval_move(PT_FIGH, 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_FIGH, 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))
|
|| sim->eval_move(PT_FIGH, 2*figh->legs[12]-figh->legs[14], figh->legs[13]+5, NULL))
|
||||||
figh->comm = (int)figh->comm | 0x04;
|
figh->comm = (int)figh->comm | 0x04;
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
Reference in New Issue
Block a user