aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
authorPaul Gilbert2018-04-02 22:42:43 -0400
committerPaul Gilbert2018-04-02 22:42:43 -0400
commita467e669b2d775388fd10d7ee420b977e23c72a5 (patch)
treeff0c325002bf488cc2113cdb62cf6e9b15cbbafe /engines
parent92b1cbbb7f4b118089e746e73a26563aad6417b0 (diff)
downloadscummvm-rg350-a467e669b2d775388fd10d7ee420b977e23c72a5.tar.gz
scummvm-rg350-a467e669b2d775388fd10d7ee420b977e23c72a5.tar.bz2
scummvm-rg350-a467e669b2d775388fd10d7ee420b977e23c72a5.zip
XEEN: Fix subtraction of Megacredits paying for castle improvements
Diffstat (limited to 'engines')
-rw-r--r--engines/xeen/party.cpp71
1 files changed, 36 insertions, 35 deletions
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index d92a4952cc..1d00632a18 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -915,45 +915,46 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
case 20:
_gameFlags[files._ccNum][takeVal] = false;
break;
- case 21: {
- bool found = false;
- for (int idx = 0; idx < 9; ++idx) {
- if (takeVal < 35) {
- if (ps._weapons[idx]._id == takeVal) {
- ps._weapons[idx].clear();
- ps._weapons.sort();
- found = true;
- break;
- }
- } else if (takeVal < 49) {
- if (ps._armor[idx]._id == (takeVal - 35)) {
- ps._armor[idx].clear();
- ps._armor.sort();
- found = true;
- break;
- }
- } else if (takeVal < 60) {
- if (ps._accessories[idx]._id == (takeVal - 49)) {
- ps._accessories[idx].clear();
- ps._accessories.sort();
- found = true;
- break;
- }
- } else if (takeVal < 82) {
- if (ps._misc[idx]._material == ((int)takeVal - 60)) {
- ps._misc[idx].clear();
- ps._misc.sort();
- found = true;
- break;
+ case 21:
+ if (takeVal >= 82) {
+ _questItems[takeVal - 82]--;
+ } else {
+ bool found = false;
+ for (int idx = 0; idx < 9; ++idx) {
+ if (takeVal < 35) {
+ if (ps._weapons[idx]._id == takeVal) {
+ ps._weapons[idx].clear();
+ ps._weapons.sort();
+ found = true;
+ break;
+ }
+ } else if (takeVal < 49) {
+ if (ps._armor[idx]._id == (takeVal - 35)) {
+ ps._armor[idx].clear();
+ ps._armor.sort();
+ found = true;
+ break;
+ }
+ } else if (takeVal < 60) {
+ if (ps._accessories[idx]._id == (takeVal - 49)) {
+ ps._accessories[idx].clear();
+ ps._accessories.sort();
+ found = true;
+ break;
+ }
+ } else {
+ if (ps._misc[idx]._material == ((int)takeVal - 60)) {
+ ps._misc[idx].clear();
+ ps._misc.sort();
+ found = true;
+ break;
+ }
}
- } else {
- _questItems[takeVal - 82]--;
}
+ if (!found)
+ return true;
}
- if (!found)
- return true;
break;
- }
case 25:
changeTime(takeVal);
break;