avoid getting stuck when un-crouching

git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@2778 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
driAn
2008-09-27 16:20:32 +00:00
parent 0262c14aeb
commit 8284aaf7b3
2 changed files with 5 additions and 2 deletions
+2
View File
@@ -241,6 +241,7 @@ bool collide(physent *d, bool spawn, float drop, float rise)
}
d->onfloor = d->o.z-eyeheight-lo < (lastmillis-d->lastcrouch<=physent::crouchtime ? 0.1f : 0.01f);
d->lastspacehi = spacehi;
}
return true;
}
@@ -605,6 +606,7 @@ void jumpn(bool on)
void updatecrouch(playerent *p, bool on)
{
if(p->crouching == on) return;
if(p==player1 && p->lastspacehi<1.0f && !on) return;
p->crouching = on;
const int progress = lastmillis-p->lastcrouch;
if(progress > physent::crouchtime) p->lastcrouch = lastmillis; // new crouch