diff options
author | Paul Gilbert | 2019-08-09 14:47:54 -0700 |
---|---|---|
committer | Paul Gilbert | 2019-08-09 14:48:04 -0700 |
commit | e9557dba1f138f972b7a28b0581f23ca0f4a72c1 (patch) | |
tree | c98ae57e0bd38a7eddb6019bd47c84f3b2ad31f3 /engines | |
parent | d76e03b23235aa72077bf821805f8dccf9ede36a (diff) | |
download | scummvm-rg350-e9557dba1f138f972b7a28b0581f23ca0f4a72c1.tar.gz scummvm-rg350-e9557dba1f138f972b7a28b0581f23ca0f4a72c1.tar.bz2 scummvm-rg350-e9557dba1f138f972b7a28b0581f23ca0f4a72c1.zip |
XEEN: Show Spell Failed dialog if enchanitem item fails
Diffstat (limited to 'engines')
-rw-r--r-- | engines/xeen/item.cpp | 22 |
1 files changed, 16 insertions, 6 deletions
diff --git a/engines/xeen/item.cpp b/engines/xeen/item.cpp index 5c0a55a3da..a384d615e2 100644 --- a/engines/xeen/item.cpp +++ b/engines/xeen/item.cpp @@ -366,9 +366,14 @@ void WeaponItems::enchantItem(int itemIndex, int amount) { tempCharacter.makeItem(amount, 0, 1); XeenItem &tempItem = tempCharacter._weapons[0]; - item._material = tempItem._material; - item._state = tempItem._state; - sound.playFX(19); + if (tempItem._material != 0 || !tempItem._state.empty()) { + item._material = tempItem._material; + item._state = tempItem._state; + sound.playFX(19); + } else { + // WORKAROUND: As an improvement on the original, show an error if the enchanting failed + ErrorScroll::show(g_vm, Res.SPELL_FAILED); + } } else { InventoryItems::enchantItem(itemIndex, amount); } @@ -533,9 +538,14 @@ void ArmorItems::enchantItem(int itemIndex, int amount) { tempCharacter.makeItem(amount, 0, 2); XeenItem &tempItem = tempCharacter._armor[0]; - item._material = tempItem._material; - item._state = tempItem._state; - sound.playFX(19); + if (tempItem._material != 0 || !tempItem._state.empty()) { + item._material = tempItem._material; + item._state = tempItem._state; + sound.playFX(19); + } else { + // WORKAROUND: As an improvement on the original, show an error if the enchanting failed + ErrorScroll::show(g_vm, Res.SPELL_FAILED); + } } else { InventoryItems::enchantItem(itemIndex, amount); } |