This commit is contained in:
Charles 2001-07-11 19:42:11 +00:00
parent 6358c9f570
commit 152f1fc93c

View File

@ -222,6 +222,29 @@ void CNpcConveyorPlatform::collidedWith( CThing *_thisThing )
m_contact = true;
}
else
{
int distLeft, distRight;
DVECTOR playerCollisionSize = player->getCollisionSize();
distLeft = collisionArea.x1 - playerPos.vx - ( playerCollisionSize.vx >> 1 );
distRight = collisionArea.x2 - playerPos.vx + ( playerCollisionSize.vx >> 1 );
DVECTOR playerShove;
playerShove.vy = 0;
if ( abs( distLeft ) < abs( distRight ) )
{
playerShove.vx = distLeft;
}
else
{
playerShove.vx = distRight;
}
player->shove( playerShove );
}
}
}
}