aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen
diff options
context:
space:
mode:
authorPaul Gilbert2019-08-09 14:47:54 -0700
committerPaul Gilbert2019-08-09 14:48:04 -0700
commite9557dba1f138f972b7a28b0581f23ca0f4a72c1 (patch)
treec98ae57e0bd38a7eddb6019bd47c84f3b2ad31f3 /engines/xeen
parentd76e03b23235aa72077bf821805f8dccf9ede36a (diff)
downloadscummvm-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/xeen')
-rw-r--r--engines/xeen/item.cpp22
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);
}