summaryrefslogtreecommitdiff
path: root/src/simulation
diff options
context:
space:
mode:
authorSimon Robertshaw <simon@hardwired.org.uk>2012-07-25 16:21:13 (GMT)
committer Simon Robertshaw <simon@hardwired.org.uk>2012-07-25 16:21:13 (GMT)
commit811c2cb26bdce4975c23c4c47d61471726dbab0d (patch)
tree486a0e9a0d3ded589e748401a3b42a68c1d528ef /src/simulation
parent5031291bf6ec26f2d60ab2fd7071e64cc5827304 (diff)
downloadpowder-811c2cb26bdce4975c23c4c47d61471726dbab0d.zip
powder-811c2cb26bdce4975c23c4c47d61471726dbab0d.tar.gz
TPT: Use eval_move(PT_FIGH, ...) when fighters are checking for obstacles 79614a9719
Diffstat (limited to 'src/simulation')
-rw-r--r--src/simulation/Simulation.cpp3
-rw-r--r--src/simulation/elements/FIGH.cpp20
2 files changed, 12 insertions, 11 deletions
diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp
index 8581347..9a347e8 100644
--- a/src/simulation/Simulation.cpp
+++ b/src/simulation/Simulation.cpp
@@ -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]++;
}
}
diff --git a/src/simulation/elements/FIGH.cpp b/src/simulation/elements/FIGH.cpp
index a28060e..7ff1156 100644
--- a/src/simulation/elements/FIGH.cpp
+++ b/src/simulation/elements/FIGH.cpp
@@ -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;