From: Tobias Gläßer Date: Wed, 3 Mar 2004 17:58:46 +0000 (+0000) Subject: Patch from Steven Geens - You couldn't jump while running... X-Git-Url: https://git.verplant.org/?a=commitdiff_plain;h=c0ddffc14eba1f6aa995ded485e299c0bf72034b;p=supertux.git Patch from Steven Geens - You couldn't jump while running into a wall.- Moving into a wall while falling SVN-Revision: 165 --- 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) {