From f8f075c3d498426cc42426148c7bb8b4ba348b9c Mon Sep 17 00:00:00 2001 From: Paul Date: Thu, 17 May 2001 16:24:28 +0000 Subject: [PATCH] --- source/platform/platform.cpp | 17 ++++++++++++----- 1 file changed, 12 insertions(+), 5 deletions(-) diff --git a/source/platform/platform.cpp b/source/platform/platform.cpp index aa3501d20..189e7cb4c 100644 --- a/source/platform/platform.cpp +++ b/source/platform/platform.cpp @@ -1200,13 +1200,20 @@ void CNpcPlatform::setTiltable( bool isTiltable ) int CNpcPlatform::getHeightFromPlatformAtPosition(int _x,int _y) { DVECTOR centre; - int y; + int angle; - // Rotate backwards to find height at current position centre=getCollisionCentre(); - y=(centre.vx-_x)*msin(-getCollisionAngle()&4095)>>12; - - return (centre.vy-_y)+y; + angle=getCollisionAngle(); + if(angle==0) + { + // Non-rotated platform + return centre.vy-_y; + } + else + { + // Rotate backwards to find height at current position + return (centre.vy-_y)+((centre.vx-_x)*msin(-angle&4095)>>12); + } } ////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////