This commit is contained in:
parent
e206363f3a
commit
25839e5bc4
1 changed files with 18 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue