diff --git a/source/player/player.cpp b/source/player/player.cpp index 2e1ab65d8..50ceecdb6 100644 --- a/source/player/player.cpp +++ b/source/player/player.cpp @@ -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) // { diff --git a/source/thing/thing.cpp b/source/thing/thing.cpp index f2d301b68..bf05f8b62 100644 --- a/source/thing/thing.cpp +++ b/source/thing/thing.cpp @@ -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 ) {