- Implement multitick viewpitch centering logic.
SVN r3512 (trunk)
This commit is contained in:
parent
ee20c2169e
commit
c5a3d846dd
3 changed files with 20 additions and 11 deletions
|
|
@ -2241,9 +2241,9 @@ void P_PlayerThink (player_t *player)
|
|||
{
|
||||
if (look == -32768 << 16)
|
||||
{ // center view
|
||||
player->mo->pitch = 0;
|
||||
player->centering = true;
|
||||
}
|
||||
else
|
||||
else if (!player->centering)
|
||||
{
|
||||
player->mo->pitch -= look;
|
||||
if (look > 0)
|
||||
|
|
@ -2257,6 +2257,22 @@ void P_PlayerThink (player_t *player)
|
|||
}
|
||||
}
|
||||
}
|
||||
if (player->centering)
|
||||
{
|
||||
if (abs(player->mo->pitch) > 2*ANGLE_1)
|
||||
{
|
||||
player->mo->pitch = FixedMul(player->mo->pitch, FRACUNIT*2/3);
|
||||
}
|
||||
else
|
||||
{
|
||||
player->mo->pitch = 0;
|
||||
player->centering = false;
|
||||
if (player - players == consoleplayer)
|
||||
{
|
||||
LocalViewPitch = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// [RH] Check for fast turn around
|
||||
if (cmd->ucmd.buttons & BT_TURN180 && !(player->oldbuttons & BT_TURN180))
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue