- gameinput.h: For PlayerAngle struct, add int settarget() overload and change one true call with a float to bvectangf().

This commit is contained in:
Mitchell Richters 2020-11-22 20:54:59 +11:00 committed by Christoph Oelckers
parent ea4ad0548a
commit 3b3e926fd3
2 changed files with 15 additions and 1 deletions

View file

@ -167,6 +167,20 @@ struct PlayerAngle
adjustment = 0;
}
void settarget(int value, bool backup = false)
{
if (!cl_syncinput)
{
target = value << BAMBITS;
if (target == 0) target += 1;
}
else
{
ang = buildang(value);
if (backup) oang = ang;
}
}
void settarget(double value, bool backup = false)
{
if (!cl_syncinput)

View file

@ -7223,7 +7223,7 @@ domovethings(void)
// auto tracking mode for single player multi-game
if (numplayers <= 1 && PlayerTrackingMode && pnum == screenpeek && screenpeek != myconnectindex)
{
Player[screenpeek].angle.settarget(FixedToFloat(gethiq16angle(Player[myconnectindex].posx - Player[screenpeek].posx, Player[myconnectindex].posy - Player[screenpeek].posy)));
Player[screenpeek].angle.settarget(bvectangf(Player[myconnectindex].posx - Player[screenpeek].posx, Player[myconnectindex].posy - Player[screenpeek].posy));
}
if (!TEST(pp->Flags, PF_DEAD))