- Duke: Remove newOwner check from cef1f8275b & cb93560a4a that were just cancelling out each other, and clean up 2x if (p->newOwner != nullptr) checks into one.

This commit is contained in:
Mitchell Richters 2021-01-03 18:45:56 +11:00
parent d3b95d4d70
commit edba971b7f
2 changed files with 10 additions and 10 deletions

View file

@ -769,9 +769,7 @@ static void processVehicleInput(player_struct *p, ControlInfo* const hidInput, I
static void FinalizeInput(player_struct *p, InputPacket& input, bool vehicle)
{
bool blocked = movementBlocked(p) || p->GetActor()->s.extra <= 0 || (p->dead_flag && !ud.god);
if (blocked && p->newOwner == nullptr)
if (movementBlocked(p) || p->GetActor()->s.extra <= 0 || (p->dead_flag && !ud.god))
{
// neutralize all movement when blocked or in automap follow mode
loc.fvel = loc.svel = 0;
@ -793,14 +791,17 @@ static void FinalizeInput(player_struct *p, InputPacket& input, bool vehicle)
loc.svel = input.svel = 0;
}
if (p->newOwner != nullptr || p->on_crane != nullptr)
if (p->newOwner != nullptr)
{
loc.avel = input.avel = 0;
}
if (p->on_crane != nullptr)
{
loc.avel = input.avel = 0;
}
if (p->newOwner != nullptr || (p->sync.actions & SB_CENTERVIEW && abs(p->horizon.horiz.asbuild()) > 5))
{
loc.horz = input.horz = 0;
if (p->sync.actions & SB_CENTERVIEW && abs(p->horizon.horiz.asbuild()) > 5)
{
loc.horz = input.horz = 0;
}
}
}
}

View file

@ -964,7 +964,6 @@ bool movementBlocked(player_struct *p)
p->hard_landing ||
p->access_incs > 0 ||
p->knee_incs > 0 ||
p->newOwner != nullptr ||
(blockingweapon() && p->kickback_pic > 1 && p->kickback_pic < weapondelay()));
}