Code: Select all
//==========================================================================
// Overlay: Gun Shifting (WIP)
// Offsets the weapon whenever turning the camera angle/pitch.
//==========================================================================
// (Currently buggy with firing weapons. Needs more fine tuning.)
Overlay.AnglePitch:
M666 A 1
{
if (GetCvar(D4D_TurningBehavior))
{
if (abs(user_offsets[0]) < 10.0)
{
user_offsets[0] += (GetPlayerInput(INPUT_YAW,DefPtr) / 32767.0) * 10.0;
//A_LogFloat(user_offsets[0]);
}
if (user_offsets[0] != 0.0)
{
if (user_offsets[0] < 1.0 && user_offsets[0] > -1.0)
{
A_WeaponOffset(user_offsets[0],0,WOF_ADD);
user_offsets[0] = 0;
}
else if (user_offsets[0] < 0.0)
{
A_WeaponOffset(user_offsets[0],0,WOF_ADD);
user_offsets[0] += 1.0;
}
else if (user_offsets[0] > 0.0)
{
A_WeaponOffset(user_offsets[0],0,WOF_ADD);
user_offsets[0] -= 1.0;
}
}
}
else
{ A_SetTics(35); }
}
Loop