- scriptified cht_Takeweaps.
This commit is contained in:
parent
bc86ec4c51
commit
f218e95c4d
4 changed files with 53 additions and 37 deletions
|
|
@ -793,19 +793,28 @@ void G_BuildTiccmd (ticcmd_t *cmd)
|
|||
//[Graf Zahl] This really helps if the mouse update rate can't be increased!
|
||||
CVAR (Bool, smooth_mouse, false, CVAR_GLOBALCONFIG|CVAR_ARCHIVE)
|
||||
|
||||
static int LookAdjust(int look)
|
||||
{
|
||||
look <<= 16;
|
||||
if (players[consoleplayer].playerstate != PST_DEAD && // No adjustment while dead.
|
||||
players[consoleplayer].ReadyWeapon != NULL) // No adjustment if no weapon.
|
||||
{
|
||||
auto scale = players[consoleplayer].ReadyWeapon->FOVScale;
|
||||
if (scale > 0) // No adjustment if it is non-positive.
|
||||
{
|
||||
look = int(look * scale);
|
||||
}
|
||||
}
|
||||
return look;
|
||||
}
|
||||
|
||||
void G_AddViewPitch (int look, bool mouse)
|
||||
{
|
||||
if (gamestate == GS_TITLELEVEL)
|
||||
{
|
||||
return;
|
||||
}
|
||||
look <<= 16;
|
||||
if (players[consoleplayer].playerstate != PST_DEAD && // No adjustment while dead.
|
||||
players[consoleplayer].ReadyWeapon != NULL && // No adjustment if no weapon.
|
||||
players[consoleplayer].ReadyWeapon->FOVScale > 0) // No adjustment if it is non-positive.
|
||||
{
|
||||
look = int(look * players[consoleplayer].ReadyWeapon->FOVScale);
|
||||
}
|
||||
look = LookAdjust(look);
|
||||
if (!level.IsFreelookAllowed())
|
||||
{
|
||||
LocalViewPitch = 0;
|
||||
|
|
@ -845,14 +854,9 @@ void G_AddViewAngle (int yaw, bool mouse)
|
|||
if (gamestate == GS_TITLELEVEL)
|
||||
{
|
||||
return;
|
||||
|
||||
}
|
||||
yaw <<= 16;
|
||||
if (players[consoleplayer].playerstate != PST_DEAD && // No adjustment while dead.
|
||||
players[consoleplayer].ReadyWeapon != NULL && // No adjustment if no weapon.
|
||||
players[consoleplayer].ReadyWeapon->FOVScale > 0) // No adjustment if it is non-positive.
|
||||
{
|
||||
yaw = int(yaw * players[consoleplayer].ReadyWeapon->FOVScale);
|
||||
}
|
||||
yaw = LookAdjust(yaw);
|
||||
LocalViewAngle -= yaw;
|
||||
if (yaw != 0)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue