fixed crouch lock-in and being stuck on stairs
git-svn-id: svn://svn.code.sf.net/p/actiongame/code/trunk/ac@1460 e016b1c5-ed68-44aa-a2f7-31cac88cffde
This commit is contained in:
@@ -207,6 +207,7 @@ void checkitems(playerent *d)
|
||||
{
|
||||
if(editmode) return;
|
||||
d->onladder = false;
|
||||
float eyeheight = d->dyneyeheight();
|
||||
loopv(ents)
|
||||
{
|
||||
entity &e = ents[i];
|
||||
@@ -216,14 +217,14 @@ void checkitems(playerent *d)
|
||||
if(OUTBORD(e.x, e.y)) continue;
|
||||
vec v(e.x, e.y, d->o.z);
|
||||
float dist1 = d->o.dist(v);
|
||||
float dist2 = d->o.z - (S(e.x, e.y)->floor+d->dyneyeheight());
|
||||
float dist2 = d->o.z - (S(e.x, e.y)->floor+eyeheight);
|
||||
if(dist1<1.5f && dist2<e.attr1) trypickup(i, d);
|
||||
continue;
|
||||
}
|
||||
|
||||
if(!e.spawned) continue;
|
||||
if(OUTBORD(e.x, e.y)) continue;
|
||||
vec v(e.x, e.y, S(e.x, e.y)->floor+d->dyneyeheight());
|
||||
vec v(e.x, e.y, S(e.x, e.y)->floor+eyeheight);
|
||||
if(d->o.dist(v)<2.5f) trypickup(i, d);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -195,7 +195,7 @@ bool collide(physent *d, bool spawn, float drop, float rise)
|
||||
{
|
||||
d->o.z = lo+d->dyneyeheight(); // stick on step
|
||||
}
|
||||
else if(spacelo>-1.26f && d->type!=ENT_BOUNCE) d->o.z += rise; // rise thru stair
|
||||
else if(spacelo>-1.26f && d->type!=ENT_BOUNCE && !d->crouching) d->o.z += rise; // rise thru stair
|
||||
else return false;
|
||||
}
|
||||
else
|
||||
@@ -497,7 +497,7 @@ void jumpn(bool on)
|
||||
|
||||
void crouch(bool on)
|
||||
{
|
||||
if(intermission || player1->onladder || !player1->onfloor) return;
|
||||
if(intermission || player1->onladder || (on && !player1->onfloor && player1->timeinair > 50)) return;
|
||||
player1->crouching = on;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user