From c0ddffc14eba1f6aa995ded485e299c0bf72034b Mon Sep 17 00:00:00 2001 From: =?utf8?q?Tobias=20Gl=C3=A4=C3=9Fer?= Date: Wed, 3 Mar 2004 17:58:46 +0000 Subject: [PATCH] Patch from Steven Geens - You couldn't jump while running into a wall.- Moving into a wall while falling SVN-Revision: 165 --- src/player.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/player.c b/src/player.c index 8b567cb72..e8ae9247a 100644 --- a/src/player.c +++ b/src/player.c @@ -147,6 +147,23 @@ void player_action(player_type* pplayer) if (!pplayer->dying) { + while(issolid( pplayer->base.x + 16, pplayer->base.y + pplayer->base.height) && !issolid( pplayer->base.x + 16, pplayer->base.y + 1)) + { + --pplayer->base.y; + } + while(issolid( pplayer->base.x + 16, pplayer->base.y + 1) && !issolid( pplayer->base.x + 16, pplayer->base.y + pplayer->base.height)) + { + ++pplayer->base.y; + } + while(issolid( pplayer->base.x - 1, pplayer->base.y + 1) || issolid( pplayer->base.x - 1, pplayer->base.y+pplayer->base.height)) + { + ++pplayer->base.x; + } + while(issolid( pplayer->base.x + 32, pplayer->base.y + 1) || issolid( pplayer->base.x + 32, pplayer->base.y+pplayer->base.height)) + { + --pplayer->base.x; + } + /*if(physic_is_set(&pplayer->vphysic)) { pplayer->base.ym = physic_get_velocity(&pplayer->vphysic); @@ -174,23 +191,6 @@ void player_action(player_type* pplayer) physic_init(&pplayer->vphysic); } - while(issolid( pplayer->base.x + 16, pplayer->base.y + pplayer->base.height) && !issolid( pplayer->base.x + 16, pplayer->base.y + 1)) - { - --pplayer->base.y; - } - while(issolid( pplayer->base.x + 16, pplayer->base.y + 1) && !issolid( pplayer->base.x + 16, pplayer->base.y + pplayer->base.height)) - { - ++pplayer->base.y; - } - while(issolid( pplayer->base.x - 1, pplayer->base.y + 1) || issolid( pplayer->base.x - 1, pplayer->base.y+pplayer->base.height)) - { - ++pplayer->base.x; - } - while(issolid( pplayer->base.x + 32, pplayer->base.y + 1) || issolid( pplayer->base.x + 32, pplayer->base.y+pplayer->base.height)) - { - --pplayer->base.x; - } - if(pplayer->base.ym < 0) { -- 2.11.0