reversed jump physics while crouching in editmode

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@6340 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
Bukz
2011-04-25 20:09:33 +00:00
parent 8df06fa6f6
commit b930b59438
4 changed files with 34 additions and 33 deletions
+5 -4
View File
@@ -402,9 +402,10 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
pl->o.add(d);
if(pl->jumpnext)
{
pl->jumpnext = false;
pl->vel.z = 2;
pl->jumpnext = true; // fly directly upwards while holding jump keybinds
pl->vel.z = 0.5f;
}
else if (pl->crouching) pl->vel.z = -0.5f; // fly directly down while holding crouch keybinds
}
else if(specfly)
{
@@ -458,7 +459,7 @@ void moveplayer(physent *pl, int moveres, bool local, int curtime)
else
{
pl->timeinair += curtime;
if (pl->trycrouch && !pl->crouching && !pl->crouchedinair) {
if (pl->trycrouch && !pl->crouching && !pl->crouchedinair && pl->state!=CS_EDITING) {
pl->vel.z += 0.3f;
pl->crouchedinair = true;
}
@@ -750,7 +751,7 @@ void updatecrouch(playerent *p, bool on)
const float crouchspeed = 0.6f;
p->crouching = on;
p->eyeheightvel = on ? -crouchspeed : crouchspeed;
if(p==player1) audiomgr.playsoundc(on ? S_CROUCH : S_UNCROUCH);
if(p==player1 && p->state!=CS_EDITING) audiomgr.playsoundc(on ? S_CROUCH : S_UNCROUCH);
}
void crouch(bool on)