- Duke: Move cancellation of spin from FinalizeInput() into applylook() in gameinput.cpp.

This commit is contained in:
Mitchell Richters 2021-01-02 10:26:16 +11:00
parent 5f33b0087f
commit 4397646cc4
2 changed files with 8 additions and 11 deletions

View file

@ -387,6 +387,7 @@ void applylook(PlayerAngle* angle, float const avel, ESyncBits* actions, double
{
// add player's input
angle->ang += degang(avel);
angle->spin = bamlook(0);
}
}

View file

@ -794,24 +794,20 @@ static void FinalizeInput(int playerNum, InputPacket& input, bool vehicle)
loc.svel = input.svel = 0;
}
if (p->on_crane == nullptr && p->newOwner == nullptr)
if (p->newOwner != nullptr)
{
if (!SyncInput() && input.avel)
{
p->angle.spin = bamlook(0);
}
}
else
if (p->on_crane != nullptr)
{
loc.avel = input.avel = 0;
}
if (p->newOwner != nullptr && ((p->sync.actions & SB_CENTERVIEW) || !(p->sync.actions & SB_CENTERVIEW) && abs(p->horizon.horiz.asbuild()) > 5))
if ((p->sync.actions & SB_CENTERVIEW) || (!(p->sync.actions & SB_CENTERVIEW) && abs(p->horizon.horiz.asbuild()) > 5))
{
loc.horz = input.horz = 0;
}
}
}
}
//---------------------------------------------------------------------------