From 9d2dc96a2e5d39c5c85294b6da6c0b105cb81b90 Mon Sep 17 00:00:00 2001 From: David Cernat Date: Fri, 14 Sep 2018 13:23:43 +0300 Subject: [PATCH] [Client] Use RANGED type for ranged attacks that haven't hit a target --- apps/openmw/mwmechanics/actors.cpp | 2 +- apps/openmw/mwmechanics/aicombat.cpp | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/apps/openmw/mwmechanics/actors.cpp b/apps/openmw/mwmechanics/actors.cpp index f96406807..7a2730e02 100644 --- a/apps/openmw/mwmechanics/actors.cpp +++ b/apps/openmw/mwmechanics/actors.cpp @@ -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; } diff --git a/apps/openmw/mwmechanics/aicombat.cpp b/apps/openmw/mwmechanics/aicombat.cpp index 3150d6b30..d364692af 100644 --- a/apps/openmw/mwmechanics/aicombat.cpp +++ b/apps/openmw/mwmechanics/aicombat.cpp @@ -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; }