Patch from Steven Geens <old_belge@hotmail.com> - You couldn't jump while running...
authorTobias Gläßer <tobi.web@gmx.de>
Wed, 3 Mar 2004 17:58:46 +0000 (17:58 +0000)
committerTobias Gläßer <tobi.web@gmx.de>
Wed, 3 Mar 2004 17:58:46 +0000 (17:58 +0000)
SVN-Revision: 165

src/player.c

index 8b567cb..e8ae924 100644 (file)
@@ -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)
         {