From 152f1fc93cfd0c842082b1a03bfd1a357ce28a6d Mon Sep 17 00:00:00 2001 From: Charles Date: Wed, 11 Jul 2001 19:42:11 +0000 Subject: [PATCH] --- source/platform/pconveyr.cpp | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/source/platform/pconveyr.cpp b/source/platform/pconveyr.cpp index c46c49e2b..842ce8b15 100644 --- a/source/platform/pconveyr.cpp +++ b/source/platform/pconveyr.cpp @@ -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 ); + } } } }