This commit is contained in:
Charles 2001-04-06 16:26:33 +00:00
parent dcc063f721
commit 6ff72ee055
2 changed files with 8 additions and 3 deletions

View File

@ -511,10 +511,12 @@ int CPlayer::getHeightFromGround(int _x,int _y,int _maxHeight)
if(isOnPlatform())
{
DVECTOR platformPos;
platformPos=m_platform->getPos();
platformPos=m_platform->getPosDelta();
DVECTOR newPos = getNewCollidedPos();
height = newPos.vy - Pos.vy;
// since collision was detected in the LAST frame, we must check to see where the platform has moved to in THIS frame
height = newPos.vy + platformPos.vy - Pos.vy;
// if(height<-_maxHeight)
// {

View File

@ -783,7 +783,10 @@ int CThing::checkCollisionAgainst(CThing *_thisThing, int _frames)
{
thatPos.vy = getNewYPos( _thisThing );
s32 verticalDelta = abs( _thisThing->getPosDelta().vy );
// vertical height change is the sum of the maximums of BOTH objects
// potentially, one object could be falling down through another object that is moving up
s32 verticalDelta = abs( _thisThing->getPosDelta().vy ) + abs( this->getPosDelta().vy );
if ( thatPos.vy - _thisThing->getPos().vy >= -verticalDelta )
{