- gameinput.h: For PlayerAngle struct, add extra addadjustment() overloads to remove type conversions game-side, and when incoming.

This commit is contained in:
Mitchell Richters 2020-11-22 21:47:13 +11:00 committed by Christoph Oelckers
parent 35845a63e2
commit 2341ed4e25

View file

@ -114,6 +114,18 @@ struct PlayerAngle
rotscrnang = orotscrnang;
}
void addadjustment(int value)
{
if (!cl_syncinput)
{
adjustment += BAngToBAM(value);
}
else
{
ang += buildang(value);
}
}
void addadjustment(double value)
{
if (!cl_syncinput)
@ -126,6 +138,30 @@ struct PlayerAngle
}
}
void addadjustment(lookangle value)
{
if (!cl_syncinput)
{
adjustment += value.asbam();
}
else
{
ang += bamang(value.asbam());
}
}
void addadjustment(binangle value)
{
if (!cl_syncinput)
{
adjustment += value.asbam();
}
else
{
ang += value;
}
}
void resetadjustment()
{
adjustment = 0;