fixing
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@4951 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
+3
-3
@@ -101,7 +101,7 @@ public:
|
||||
int timeinair; // used for fake gravity
|
||||
float radius, eyeheight, maxeyeheight, aboveeye; // bounding box size
|
||||
bool inwater;
|
||||
bool onfloor, onladder, jumpnext, crouching, trycrouch, cancollide, stuck;
|
||||
bool onfloor, onladder, jumpnext, crouching, crouchedinair, trycrouch, cancollide, stuck;
|
||||
int lastjump;
|
||||
int lastsplash;
|
||||
char move, strafe;
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
float eyeheightvel;
|
||||
|
||||
physent() : o(0, 0, 0), deltapos(0, 0, 0), newpos(0, 0, 0), yaw(270), pitch(0), roll(0), pitchvel(0),
|
||||
crouching(false), trycrouch(false), cancollide(true), stuck(false), lastjump(0), lastsplash(0), state(CS_ALIVE)
|
||||
crouching(false), crouchedinair(false), trycrouch(false), cancollide(true), stuck(false), lastjump(0), lastsplash(0), state(CS_ALIVE)
|
||||
{
|
||||
reset();
|
||||
}
|
||||
@@ -127,7 +127,7 @@ public:
|
||||
vel.x = vel.y = vel.z = eyeheightvel = 0.0f;
|
||||
move = strafe = 0;
|
||||
timeinair = lastjump = lastsplash = 0;
|
||||
onfloor = onladder = inwater = jumpnext = crouching = trycrouch = stuck = false;
|
||||
onfloor = onladder = inwater = jumpnext = crouching = crouchedinair = trycrouch = stuck = false;
|
||||
}
|
||||
|
||||
virtual void oncollision() {}
|
||||
|
||||
@@ -444,12 +444,15 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
|
||||
pl->lastjump = lastmillis;
|
||||
}
|
||||
pl->timeinair = 0;
|
||||
pl->crouchedinair = false;
|
||||
}
|
||||
else
|
||||
{
|
||||
pl->timeinair += curtime;
|
||||
if (pl->trycrouch && !pl->crouching) pl->vel.z += 0.8f;
|
||||
if (!pl->trycrouch && pl->crouching) pl->vel.z -= 0.8f;
|
||||
if (pl->trycrouch && !pl->crouching && !pl->crouchedinair) {
|
||||
pl->vel.z += 0.6f;
|
||||
pl->crouchedinair = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user