# HG changeset patch # User John Tsiombikas # Date 1412360878 -10800 # Node ID 3e6757655fe208530550fde6bfc96ca4b1ff6809 # Parent df3a70664a7d4ef61c5c6ea8159b8fbffcdea6e4 fixed climbing stairs diff -r df3a70664a7d -r 3e6757655fe2 src/game.cc --- a/src/game.cc Fri Oct 03 20:36:24 2014 +0300 +++ b/src/game.cc Fri Oct 03 21:27:58 2014 +0300 @@ -138,9 +138,13 @@ if(floor_pos.y < cam_pos.y) { cam_vvel += grav * dt; cam_pos.y += cam_vvel * dt; - if(cam_pos.y < floor_pos.y) { + if(cam_pos.y <= floor_pos.y) { cam_pos.y = floor_pos.y; + cam_vvel = 0; } + } else { + cam_pos.y = floor_pos.y; + cam_vvel = 0; } } @@ -313,7 +317,7 @@ scn.obj[i]->draw(); } - glPushAttrib(GL_ENABLE_BIT); + /*glPushAttrib(GL_ENABLE_BIT); glDisable(GL_DEPTH_TEST); glDisable(GL_LIGHTING); @@ -325,7 +329,7 @@ glColor3f(1, 1, 1); glEnd(); - glPopAttrib(); + glPopAttrib();*/ } static void material(float r, float g, float b, float roughness)