From 08d1dd06ed77970a4ad5fe1b1db7bfbf857f74d5 Mon Sep 17 00:00:00 2001 From: Simon Robertshaw Date: Wed, 25 Jul 2012 15:47:18 +0100 Subject: [PATCH] TPT: Fix STKM causing stacking and falling through some powders c14704ae49 --- src/simulation/Simulation.cpp | 25 ++++++++++++++----------- src/simulation/elements/STKM.cpp | 19 ++++++++++--------- 2 files changed, 24 insertions(+), 20 deletions(-) diff --git a/src/simulation/Simulation.cpp b/src/simulation/Simulation.cpp index 6d71b7445..ab81912e1 100644 --- a/src/simulation/Simulation.cpp +++ b/src/simulation/Simulation.cpp @@ -1810,7 +1810,7 @@ void Simulation::init_can_move() // 1 = Swap // 2 = Both particles occupy the same space. // 3 = Varies, go run some extra checks - int t, rt; + int t, rt, stkm_move; for (rt=0;rtdr) { - if (!sim->eval_move(PT_DUST, playerp->legs[4], playerp->legs[5], NULL)) + if (!sim->eval_move(t, playerp->legs[4], playerp->legs[5], NULL)) { playerp->accs[2] = -3*gvy-3*gvx; playerp->accs[3] = 3*gvx-3*gvy; @@ -197,7 +198,7 @@ int Element_STKM::run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { } else { - if (!sim->eval_move(PT_DUST, playerp->legs[12], playerp->legs[13], NULL)) + if (!sim->eval_move(t, playerp->legs[12], playerp->legs[13], NULL)) { playerp->accs[6] = -3*gvy-3*gvx; playerp->accs[7] = 3*gvx-3*gvy; @@ -212,7 +213,7 @@ int Element_STKM::run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { { if (dleval_move(PT_DUST, playerp->legs[4], playerp->legs[5], NULL)) + if (!sim->eval_move(t, playerp->legs[4], playerp->legs[5], NULL)) { playerp->accs[2] = 3*gvy-3*gvx; playerp->accs[3] = -3*gvx-3*gvy; @@ -222,7 +223,7 @@ int Element_STKM::run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { } else { - if (!sim->eval_move(PT_DUST, playerp->legs[12], playerp->legs[13], NULL)) + if (!sim->eval_move(t, playerp->legs[12], playerp->legs[13], NULL)) { playerp->accs[6] = 3*gvy-3*gvx; playerp->accs[7] = -3*gvx-3*gvy; @@ -234,7 +235,7 @@ int Element_STKM::run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { //Jump if (((int)(playerp->comm)&0x04) == 0x04 && - (!sim->eval_move(PT_DUST, playerp->legs[4], playerp->legs[5], NULL) || !sim->eval_move(PT_DUST, playerp->legs[12], playerp->legs[13], NULL))) + (!sim->eval_move(t, playerp->legs[4], playerp->legs[5], NULL) || !sim->eval_move(t, playerp->legs[12], playerp->legs[13], NULL))) { parts[i].vy -= 4*gvy; playerp->accs[3] -= gvy; @@ -385,27 +386,27 @@ int Element_STKM::run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { playerp->legs[8] += (playerp->legs[8]-parts[i].x)*d; playerp->legs[9] += (playerp->legs[9]-parts[i].y)*d; - if (INBOND(playerp->legs[4], playerp->legs[5]) && !sim->eval_move(PT_DUST, playerp->legs[4], playerp->legs[5], NULL)) + if (INBOND(playerp->legs[4], playerp->legs[5]) && !sim->eval_move(t, playerp->legs[4], playerp->legs[5], NULL)) { playerp->legs[4] = playerp->legs[6]; playerp->legs[5] = playerp->legs[7]; } - if (INBOND(playerp->legs[12], playerp->legs[13]) && !sim->eval_move(PT_DUST, playerp->legs[12], playerp->legs[13], NULL)) + if (INBOND(playerp->legs[12], playerp->legs[13]) && !sim->eval_move(t, playerp->legs[12], playerp->legs[13], NULL)) { playerp->legs[12] = playerp->legs[14]; playerp->legs[13] = playerp->legs[15]; } //This makes stick man "pop" from obstacles - if (INBOND(playerp->legs[4], playerp->legs[5]) && !sim->eval_move(PT_DUST, playerp->legs[4], playerp->legs[5], NULL)) + if (INBOND(playerp->legs[4], playerp->legs[5]) && !sim->eval_move(t, playerp->legs[4], playerp->legs[5], NULL)) { float t; t = playerp->legs[4]; playerp->legs[4] = playerp->legs[6]; playerp->legs[6] = t; t = playerp->legs[5]; playerp->legs[5] = playerp->legs[7]; playerp->legs[7] = t; } - if (INBOND(playerp->legs[12], playerp->legs[13]) && !sim->eval_move(PT_DUST, playerp->legs[12], playerp->legs[13], NULL)) + if (INBOND(playerp->legs[12], playerp->legs[13]) && !sim->eval_move(t, playerp->legs[12], playerp->legs[13], NULL)) { float t; t = playerp->legs[12]; playerp->legs[12] = playerp->legs[14]; playerp->legs[14] = t;