From 25839e5bc409312c0521846ea1312e92b44317a5 Mon Sep 17 00:00:00 2001 From: Charles Date: Fri, 20 Jul 2001 15:03:51 +0000 Subject: [PATCH] --- source/friend/fgary.cpp | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/source/friend/fgary.cpp b/source/friend/fgary.cpp index 06a30b5ea..6a4c47b59 100644 --- a/source/friend/fgary.cpp +++ b/source/friend/fgary.cpp @@ -269,6 +269,24 @@ void CNpcGaryFriend::think( int _frames ) } } + // sort out draw rotation + + DVECTOR testPos1, testPos2; + + testPos1 = testPos2 = Pos; + testPos1.vx -= 10; + testPos2.vx += 10; + + testPos1.vy += CGameScene::getCollision()->getHeightFromGroundNonSB( testPos1.vx, testPos1.vy, 16 ); + testPos2.vy += CGameScene::getCollision()->getHeightFromGroundNonSB( testPos2.vx, testPos2.vy, 16 ); + + s32 xDist = testPos2.vx - testPos1.vx; + s32 yDist = testPos2.vy - testPos1.vy; + + s16 heading = ratan2( yDist, xDist ); + + m_drawRotation = heading; + m_obstructed = false; }