[Client] Use RANGED type for ranged attacks that haven't hit a target

pull/473/head
David Cernat 6 years ago
parent af49f711ca
commit 9d2dc96a2e

@ -1411,7 +1411,7 @@ namespace MWMechanics
if (localAttack->pressed != state)
{
MechanicsHelper::resetAttack(localAttack);
localAttack->type = mwmp::Attack::MELEE;
localAttack->type = MechanicsHelper::isUsingRangedWeapon(player) ? mwmp::Attack::RANGED : mwmp::Attack::MELEE;
localAttack->pressed = state;
localAttack->shouldSend = true;
}

@ -155,7 +155,6 @@ namespace MWMechanics
if (localAttack && localAttack->pressed != storage.mAttack)
{
MechanicsHelper::resetAttack(localAttack);
localAttack->type = mwmp::Attack::MELEE;
localAttack->pressed = storage.mAttack;
localAttack->shouldSend = true;
}
@ -227,7 +226,6 @@ namespace MWMechanics
if (localAttack && localAttack->pressed != false)
{
MechanicsHelper::resetAttack(localAttack);
localAttack->type = mwmp::Attack::MELEE;
localAttack->pressed = false;
localAttack->shouldSend = true;
}
@ -580,7 +578,7 @@ namespace MWMechanics
if (localAttack && localAttack->pressed != true)
{
MechanicsHelper::resetAttack(localAttack);
localAttack->type = mwmp::Attack::MELEE;
localAttack->type = distantCombat ? mwmp::Attack::MELEE : mwmp::Attack::RANGED;
localAttack->pressed = true;
localAttack->shouldSend = true;
}

Loading…
Cancel
Save