diff options
| author | spp <none@none> | 2009-12-13 09:17:12 +0100 |
|---|---|---|
| committer | spp <none@none> | 2009-12-13 09:17:12 +0100 |
| commit | df76273dd0f6fdfd2d3e2ba7f04e2a089ba8d4b8 (patch) | |
| tree | f18035fda1c3d2003bce7cf08cf1315f1779a3d9 /src/game/Player.cpp | |
| parent | 839e5624c4dfa26cffed76905864a9d761099cea (diff) | |
Check of required skill value and level in Item enchants, by azazel. Closes #512
* Added some cosmetic changes to the original patch
--HG--
branch : trunk
Diffstat (limited to 'src/game/Player.cpp')
| -rw-r--r-- | src/game/Player.cpp | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/game/Player.cpp b/src/game/Player.cpp index bf9f1f63c62..c6e762d7950 100644 --- a/src/game/Player.cpp +++ b/src/game/Player.cpp @@ -10666,6 +10666,12 @@ uint8 Player::CanUseItem( Item *pItem, bool not_loading ) const if (getLevel() < pProto->RequiredLevel) return EQUIP_ERR_CANT_EQUIP_LEVEL_I; + if (getLevel() < pItem->GetEnchantRequiredLevel()) + return EQUIP_ERR_CANT_EQUIP_LEVEL_I; + + if (!pItem->HasEnchantRequiredSkill(this)) + return EQUIP_ERR_NO_REQUIRED_PROFICIENCY; + return EQUIP_ERR_OK; } } |
