aboutsummaryrefslogtreecommitdiff
path: root/engines/xeen/item.cpp
diff options
context:
space:
mode:
authorPaul Gilbert2018-03-15 20:52:36 -0400
committerPaul Gilbert2018-03-15 20:52:36 -0400
commit39640017e644ed28c8e397f7e2bd8dd6657d35f9 (patch)
tree3acf8240129c89832b86fcf51c386f6ddea5c564 /engines/xeen/item.cpp
parent5584e7ec3701928caaeff90ac3dbe99cb86a03bb (diff)
downloadscummvm-rg350-39640017e644ed28c8e397f7e2bd8dd6657d35f9.tar.gz
scummvm-rg350-39640017e644ed28c8e397f7e2bd8dd6657d35f9.tar.bz2
scummvm-rg350-39640017e644ed28c8e397f7e2bd8dd6657d35f9.zip
XEEN: Don't needlessly show class profiency error dialogs when just viewing inventory
Diffstat (limited to 'engines/xeen/item.cpp')
-rw-r--r--engines/xeen/item.cpp14
1 files changed, 7 insertions, 7 deletions
diff --git a/engines/xeen/item.cpp b/engines/xeen/item.cpp
index e5e852c6b7..7a4b459d41 100644
--- a/engines/xeen/item.cpp
+++ b/engines/xeen/item.cpp
@@ -93,7 +93,7 @@ void InventoryItems::clear() {
operator[](idx).clear();
}
-bool InventoryItems::passRestrictions(int itemId, bool showError) const {
+bool InventoryItems::passRestrictions(int itemId, bool suppressError) const {
CharacterClass charClass = _character->_class;
switch (charClass) {
@@ -120,7 +120,7 @@ bool InventoryItems::passRestrictions(int itemId, bool showError) const {
}
Common::String name = _names[itemId];
- if (showError) {
+ if (!suppressError) {
Common::String msg = Common::String::format(Res.NOT_PROFICIENT,
Res.CLASS_NAMES[charClass], name.c_str());
ErrorScroll::show(Party::_vm, msg, WT_FREEZE_WAIT);
@@ -239,7 +239,7 @@ void WeaponItems::equipItem(int itemIndex) {
XeenItem &item = operator[](itemIndex);
if (item._id <= 17) {
- if (passRestrictions(item._id, false)) {
+ if (passRestrictions(item._id)) {
for (uint idx = 0; idx < size(); ++idx) {
XeenItem &i = operator[](idx);
if (i._frame == 13 || i._frame == 1) {
@@ -251,7 +251,7 @@ void WeaponItems::equipItem(int itemIndex) {
item._frame = 1;
}
} else if (item._id >= 30 && item._id <= 33) {
- if (passRestrictions(item._id, false)) {
+ if (passRestrictions(item._id)) {
for (uint idx = 0; idx < size(); ++idx) {
XeenItem &i = operator[](idx);
if (i._frame == 4) {
@@ -263,7 +263,7 @@ void WeaponItems::equipItem(int itemIndex) {
item._frame = 4;
}
} else {
- if (passRestrictions(item._id, false)) {
+ if (passRestrictions(item._id)) {
for (uint idx = 0; idx < size(); ++idx) {
XeenItem &i = operator[](idx);
if (i._frame == 13 || i._frame == 1) {
@@ -368,7 +368,7 @@ void ArmorItems::equipItem(int itemIndex) {
XeenItem &item = operator[](itemIndex);
if (item._id <= 7) {
- if (passRestrictions(item._id, false)) {
+ if (passRestrictions(item._id)) {
for (uint idx = 0; idx < size(); ++idx) {
XeenItem &i = operator[](idx);
if (i._frame == 9) {
@@ -380,7 +380,7 @@ void ArmorItems::equipItem(int itemIndex) {
item._frame = 3;
}
} else if (item._id == 8) {
- if (passRestrictions(item._id, false)) {
+ if (passRestrictions(item._id)) {
for (uint idx = 0; idx < size(); ++idx) {
XeenItem &i = operator[](idx);
if (i._frame == 2) {