Skip to content

Commit

Permalink
Add on-strike enchantment support for ranged weapon types
Browse files Browse the repository at this point in the history
  • Loading branch information
darkbasic committed Feb 9, 2023
1 parent a41cbfb commit d92c69e
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
6 changes: 4 additions & 2 deletions apps/openmw/mwmechanics/combat.cpp
Expand Up @@ -275,8 +275,10 @@ namespace MWMechanics
}
}

// Apply "On hit" effect of the projectile
bool appliedEnchantment = applyOnStrikeEnchantment(attacker, victim, projectile, hitPosition, true);
// Apply "On hit" effect of the weapon & projectile
bool appliedEnchantment = applyOnStrikeEnchantment(attacker, victim, weapon, hitPosition, true);
if (weapon != projectile)
appliedEnchantment = applyOnStrikeEnchantment(attacker, victim, projectile, hitPosition, true);

if (validVictim)
{
Expand Down
6 changes: 2 additions & 4 deletions apps/openmw/mwmechanics/enchanting.cpp
Expand Up @@ -150,13 +150,11 @@ namespace MWMechanics
case ESM::Enchantment::WhenUsed:
if (powerfulSoul && weapclass != ESM::WeaponType::Ammo && weapclass != ESM::WeaponType::Thrown)
mCastStyle = ESM::Enchantment::ConstantEffect;
else if (weapclass != ESM::WeaponType::Ranged)
else
mCastStyle = ESM::Enchantment::WhenStrikes;
return;
default: // takes care of Constant effect too
mCastStyle = ESM::Enchantment::WhenUsed;
if (weapclass != ESM::WeaponType::Ranged)
mCastStyle = ESM::Enchantment::WhenStrikes;
mCastStyle = ESM::Enchantment::WhenStrikes;
return;
}
}
Expand Down

0 comments on commit d92c69e

Please sign in to comment.