mirror of
https://github.com/TES3MP/openmw-tes3mp.git
synced 2025-04-01 11:06:41 +00:00
Small azura's star fix
This commit is contained in:
parent
50932a7a6b
commit
194ca2584d
1 changed files with 8 additions and 5 deletions
|
@ -53,14 +53,18 @@ namespace MWMechanics
|
||||||
|
|
||||||
bool Enchanting::create()
|
bool Enchanting::create()
|
||||||
{
|
{
|
||||||
|
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
||||||
ESM::Enchantment enchantment;
|
ESM::Enchantment enchantment;
|
||||||
enchantment.mData.mCharge = getGemCharge();
|
enchantment.mData.mCharge = getGemCharge();
|
||||||
|
|
||||||
//Exception for Azura Star, it's not destroyed after enchanting
|
mSoulGemPtr.getRefData().setCount (mSoulGemPtr.getRefData().getCount()-1);
|
||||||
|
|
||||||
|
//Exception for Azura Star, new one will be added after enchanting
|
||||||
if(boost::iequals(mSoulGemPtr.get<ESM::Miscellaneous>()->mBase->mId, "Misc_SoulGem_Azura"))
|
if(boost::iequals(mSoulGemPtr.get<ESM::Miscellaneous>()->mBase->mId, "Misc_SoulGem_Azura"))
|
||||||
mSoulGemPtr.getCellRef().mSoul="";
|
{
|
||||||
else
|
MWWorld::ManualRef azura (MWBase::Environment::get().getWorld()->getStore(), "Misc_SoulGem_Azura");
|
||||||
mSoulGemPtr.getRefData().setCount (mSoulGemPtr.getRefData().getCount()-1);
|
MWWorld::Class::get (player).getContainerStore (player).add (azura.getPtr());
|
||||||
|
}
|
||||||
|
|
||||||
if(mSelfEnchanting)
|
if(mSelfEnchanting)
|
||||||
{
|
{
|
||||||
|
@ -87,7 +91,6 @@ namespace MWMechanics
|
||||||
MWWorld::ManualRef ref (MWBase::Environment::get().getWorld()->getStore(), mOldItemId);
|
MWWorld::ManualRef ref (MWBase::Environment::get().getWorld()->getStore(), mOldItemId);
|
||||||
ref.getPtr().getRefData().setCount (mOldItemCount-1);
|
ref.getPtr().getRefData().setCount (mOldItemCount-1);
|
||||||
|
|
||||||
MWWorld::Ptr player = MWBase::Environment::get().getWorld()->getPlayer().getPlayer();
|
|
||||||
MWWorld::Class::get (player).getContainerStore (player).add (ref.getPtr());
|
MWWorld::Class::get (player).getContainerStore (player).add (ref.getPtr());
|
||||||
if(!mSelfEnchanting)
|
if(!mSelfEnchanting)
|
||||||
payForEnchantment();
|
payForEnchantment();
|
||||||
|
|
Loading…
Reference in a new issue