forked from teamnwah/openmw-tes3coop
Don't enchant if the enchantment value is too high for the item
This commit is contained in:
parent
a359ba6a2f
commit
04673b2f14
1 changed files with 13 additions and 7 deletions
|
@ -158,7 +158,7 @@ namespace MWGui
|
||||||
|
|
||||||
if(mEnchanting.getGemCharge()==0)
|
if(mEnchanting.getGemCharge()==0)
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage32}", std::vector<std::string>());
|
mWindowManager.messageBox ("#{sNotifyMessage32}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -222,31 +222,37 @@ namespace MWGui
|
||||||
{
|
{
|
||||||
if (mEffects.size() <= 0)
|
if (mEffects.size() <= 0)
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage30}", std::vector<std::string>());
|
mWindowManager.messageBox ("#{sNotifyMessage30}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mName->getCaption ().empty())
|
if (mName->getCaption ().empty())
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage10}", std::vector<std::string>());
|
mWindowManager.messageBox ("#{sNotifyMessage10}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (boost::lexical_cast<int>(mPrice->getCaption()) > mWindowManager.getInventoryWindow()->getPlayerGold())
|
if (boost::lexical_cast<int>(mPrice->getCaption()) > mWindowManager.getInventoryWindow()->getPlayerGold())
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage18}", std::vector<std::string>());
|
mWindowManager.messageBox ("#{sNotifyMessage18}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mEnchanting.soulEmpty())
|
if (mEnchanting.soulEmpty())
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage52}", std::vector<std::string>());
|
mWindowManager.messageBox ("#{sNotifyMessage52}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mEnchanting.itemEmpty())
|
if (mEnchanting.itemEmpty())
|
||||||
{
|
{
|
||||||
mWindowManager.messageBox ("#{sNotifyMessage11}", std::vector<std::string>());
|
mWindowManager.messageBox ("#{sNotifyMessage11}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (mEnchanting.getEnchantCost() > mEnchanting.getMaxEnchantValue())
|
||||||
|
{
|
||||||
|
mWindowManager.messageBox ("#{sNotifyMessage29}");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -254,7 +260,7 @@ namespace MWGui
|
||||||
mEnchanting.setEffect(mEffectList);
|
mEnchanting.setEffect(mEffectList);
|
||||||
|
|
||||||
mEnchanting.create();
|
mEnchanting.create();
|
||||||
mWindowManager.messageBox ("#{sEnchantmentMenu12}", std::vector<std::string>());
|
mWindowManager.messageBox ("#{sEnchantmentMenu12}");
|
||||||
mWindowManager.removeGuiMode (GM_Enchanting);
|
mWindowManager.removeGuiMode (GM_Enchanting);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue