[Scummvm-git-logs] scummvm master -> e9557dba1f138f972b7a28b0581f23ca0f4a72c1
dreammaster
paulfgilbert at gmail.com
Fri Aug 9 23:48:12 CEST 2019
This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://github.com/scummvm/scummvm .
Summary:
e9557dba1f XEEN: Show Spell Failed dialog if enchanitem item fails
Commit: e9557dba1f138f972b7a28b0581f23ca0f4a72c1
https://github.com/scummvm/scummvm/commit/e9557dba1f138f972b7a28b0581f23ca0f4a72c1
Author: Paul Gilbert (dreammaster at scummvm.org)
Date: 2019-08-09T14:48:04-07:00
Commit Message:
XEEN: Show Spell Failed dialog if enchanitem item fails
Changed paths:
engines/xeen/item.cpp
diff --git a/engines/xeen/item.cpp b/engines/xeen/item.cpp
index 5c0a55a..a384d61 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);
}
More information about the Scummvm-git-logs
mailing list