mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-02-21 18:39:40 +00:00
Merge pull request #2564 from Capostrophic/enchant
Remove on-strike enchantment support for ranged weapon types (bug #5190)
This commit is contained in:
commit
afb218fe29
4 changed files with 14 additions and 11 deletions
|
@ -164,6 +164,7 @@
|
||||||
Bug #5177: Editor: Unexplored map tiles get corrupted after a file with terrain is saved
|
Bug #5177: Editor: Unexplored map tiles get corrupted after a file with terrain is saved
|
||||||
Bug #5182: OnPCEquip doesn't trigger on skipped beast race attempts to equip something not equippable by beasts
|
Bug #5182: OnPCEquip doesn't trigger on skipped beast race attempts to equip something not equippable by beasts
|
||||||
Bug #5186: Equipped item enchantments don't affect creatures
|
Bug #5186: Equipped item enchantments don't affect creatures
|
||||||
|
Bug #5190: On-strike enchantments can be applied to and used with non-projectile ranged weapons
|
||||||
Feature #1774: Handle AvoidNode
|
Feature #1774: Handle AvoidNode
|
||||||
Feature #2229: Improve pathfinding AI
|
Feature #2229: Improve pathfinding AI
|
||||||
Feature #3025: Analogue gamepad movement controls
|
Feature #3025: Analogue gamepad movement controls
|
||||||
|
|
|
@ -246,10 +246,8 @@ namespace MWMechanics
|
||||||
|
|
||||||
reduceWeaponCondition(damage, validVictim, weapon, attacker);
|
reduceWeaponCondition(damage, validVictim, weapon, attacker);
|
||||||
|
|
||||||
// Apply "On hit" effect of the weapon & projectile
|
// Apply "On hit" effect of the projectile
|
||||||
bool appliedEnchantment = applyOnStrikeEnchantment(attacker, victim, weapon, hitPosition, true);
|
bool appliedEnchantment = applyOnStrikeEnchantment(attacker, victim, projectile, hitPosition, true);
|
||||||
if (weapon != projectile)
|
|
||||||
appliedEnchantment = applyOnStrikeEnchantment(attacker, victim, projectile, hitPosition, true);
|
|
||||||
|
|
||||||
if (validVictim)
|
if (validVictim)
|
||||||
{
|
{
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
#include "creaturestats.hpp"
|
#include "creaturestats.hpp"
|
||||||
#include "spellcasting.hpp"
|
#include "spellcasting.hpp"
|
||||||
#include "actorutil.hpp"
|
#include "actorutil.hpp"
|
||||||
|
#include "weapontype.hpp"
|
||||||
|
|
||||||
namespace MWMechanics
|
namespace MWMechanics
|
||||||
{
|
{
|
||||||
|
@ -25,13 +26,13 @@ namespace MWMechanics
|
||||||
void Enchanting::setOldItem(const MWWorld::Ptr& oldItem)
|
void Enchanting::setOldItem(const MWWorld::Ptr& oldItem)
|
||||||
{
|
{
|
||||||
mOldItemPtr=oldItem;
|
mOldItemPtr=oldItem;
|
||||||
|
mWeaponType = -1;
|
||||||
|
mObjectType.clear();
|
||||||
if(!itemEmpty())
|
if(!itemEmpty())
|
||||||
{
|
{
|
||||||
mObjectType = mOldItemPtr.getTypeName();
|
mObjectType = mOldItemPtr.getTypeName();
|
||||||
}
|
if (mObjectType == typeid(ESM::Weapon).name())
|
||||||
else
|
mWeaponType = mOldItemPtr.get<ESM::Weapon>()->mBase->mData.mType;
|
||||||
{
|
|
||||||
mObjectType="";
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -119,7 +120,7 @@ namespace MWMechanics
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if(mObjectType == typeid(ESM::Weapon).name())
|
else if (mWeaponType != -1)
|
||||||
{ // Weapon
|
{ // Weapon
|
||||||
switch(mCastStyle)
|
switch(mCastStyle)
|
||||||
{
|
{
|
||||||
|
@ -129,11 +130,13 @@ namespace MWMechanics
|
||||||
case ESM::Enchantment::WhenUsed:
|
case ESM::Enchantment::WhenUsed:
|
||||||
if (powerfulSoul)
|
if (powerfulSoul)
|
||||||
mCastStyle = ESM::Enchantment::ConstantEffect;
|
mCastStyle = ESM::Enchantment::ConstantEffect;
|
||||||
else
|
else if (getWeaponType(mWeaponType)->mWeaponClass != ESM::WeaponType::Ranged)
|
||||||
mCastStyle = ESM::Enchantment::WhenStrikes;
|
mCastStyle = ESM::Enchantment::WhenStrikes;
|
||||||
return;
|
return;
|
||||||
default: // takes care of Constant effect too
|
default: // takes care of Constant effect too
|
||||||
mCastStyle = ESM::Enchantment::WhenStrikes;
|
mCastStyle = ESM::Enchantment::WhenUsed;
|
||||||
|
if (getWeaponType(mWeaponType)->mWeaponClass != ESM::WeaponType::Ranged)
|
||||||
|
mCastStyle = ESM::Enchantment::WhenStrikes;
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -23,6 +23,7 @@ namespace MWMechanics
|
||||||
|
|
||||||
std::string mNewItemName;
|
std::string mNewItemName;
|
||||||
std::string mObjectType;
|
std::string mObjectType;
|
||||||
|
int mWeaponType;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
Enchanting();
|
Enchanting();
|
||||||
|
|
Loading…
Reference in a new issue