From 811c2cb26bdce4975c23c4c47d61471726dbab0d Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 25 Jul 2012 17:21:13 +0100 Subject: [PATCH] TPT: Use eval_move(PT_FIGH, ...) when fighters are checking for obstacles 79614a9719 --- src/simulation/Simulation.cpp | 3 ++- src/simulation/elements/FIGH.cpp | 20 ++++++++++---------- 2 files changed, 12 insertions(+), 11 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 858134772..9a347e828 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 a28060e93..7ff11566a 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 (tarxeval_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;