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

fix/skillcap
David Cernat 6 years ago
parent af49f711ca
commit 9d2dc96a2e

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

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

Loading…
Cancel
Save