This commit is contained in:
Charles 2001-07-20 15:03:51 +00:00
parent e206363f3a
commit 25839e5bc4

View File

@ -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;
}