From c14704ae492834d9a888537b973a9b5a8585e3b3 Mon Sep 17 00:00:00 2001 From: jacksonmj Date: Sun, 17 Jun 2012 23:54:47 +0100 Subject: [PATCH] Fix STKM causing stacking and falling through some powders --- src/elements/stkm.c | 23 ++++++++++++----------- src/powder.c | 25 ++++++++++++++----------- 2 files changed, 26 insertions(+), 22 deletions(-) diff --git a/src/elements/stkm.c b/src/elements/stkm.c index d0bd14a27..1a43525c9 100644 --- a/src/elements/stkm.c +++ b/src/elements/stkm.c @@ -48,6 +48,7 @@ int graphics_STKM(GRAPHICS_FUNC_ARGS) int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { int r, rx, ry; + int t = parts[i].type; float pp, d; float dt = 0.9;///(FPSB*FPSB); //Delta time in square float gvx, gvy; @@ -57,7 +58,7 @@ int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { playerp->elem = parts[i].ctype; playerp->frames++; - //Tempirature handling + //Temperature handling if (parts[i].temp<243) parts[i].life -= 1; if ((parts[i].temp<309.6f) && (parts[i].temp>=243)) @@ -132,7 +133,7 @@ int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { playerp->legs[15] = playerp->legs[13]; playerp->legs[13] = pp; - //Setting accseleration to 0 + //Setting acceleration to 0 playerp->accs[0] = 0; playerp->accs[1] = 0; @@ -155,7 +156,7 @@ int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { { if (dl>dr) { - if (!eval_move(PT_DUST, playerp->legs[4], playerp->legs[5], NULL)) + if (!eval_move(t, playerp->legs[4], playerp->legs[5], NULL)) { playerp->accs[2] = -3*gvy-3*gvx; playerp->accs[3] = 3*gvx-3*gvy; @@ -165,7 +166,7 @@ int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { } else { - if (!eval_move(PT_DUST, playerp->legs[12], playerp->legs[13], NULL)) + if (!eval_move(t, playerp->legs[12], playerp->legs[13], NULL)) { playerp->accs[6] = -3*gvy-3*gvx; playerp->accs[7] = 3*gvx-3*gvy; @@ -180,7 +181,7 @@ int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { { if (dllegs[4], playerp->legs[5], NULL)) + if (!eval_move(t, playerp->legs[4], playerp->legs[5], NULL)) { playerp->accs[2] = 3*gvy-3*gvx; playerp->accs[3] = -3*gvx-3*gvy; @@ -190,7 +191,7 @@ int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { } else { - if (!eval_move(PT_DUST, playerp->legs[12], playerp->legs[13], NULL)) + if (!eval_move(t, playerp->legs[12], playerp->legs[13], NULL)) { playerp->accs[6] = 3*gvy-3*gvx; playerp->accs[7] = -3*gvx-3*gvy; @@ -202,7 +203,7 @@ int run_stickman(playerst* playerp, UPDATE_FUNC_ARGS) { //Jump if (((int)(playerp->comm)&0x04) == 0x04 && - (!eval_move(PT_DUST, playerp->legs[4], playerp->legs[5], NULL) || !eval_move(PT_DUST, playerp->legs[12], playerp->legs[13], NULL))) + (!eval_move(t, playerp->legs[4], playerp->legs[5], NULL) || !eval_move(t, playerp->legs[12], playerp->legs[13], NULL))) { parts[i].vy -= 4*gvy; playerp->accs[3] -= gvy; @@ -353,27 +354,27 @@ int 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]) && !eval_move(PT_DUST, playerp->legs[4], playerp->legs[5], NULL)) + if (INBOND(playerp->legs[4], playerp->legs[5]) && !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]) && !eval_move(PT_DUST, playerp->legs[12], playerp->legs[13], NULL)) + if (INBOND(playerp->legs[12], playerp->legs[13]) && !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]) && !eval_move(PT_DUST, playerp->legs[4], playerp->legs[5], NULL)) + if (INBOND(playerp->legs[4], playerp->legs[5]) && !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]) && !eval_move(PT_DUST, playerp->legs[12], playerp->legs[13], NULL)) + if (INBOND(playerp->legs[12], playerp->legs[13]) && !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; diff --git a/src/powder.c b/src/powder.c index 6615bbe25..9dd2fd16a 100644 --- a/src/powder.c +++ b/src/powder.c @@ -95,7 +95,7 @@ void 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;rt