XEEN: Fix display of given treasure

This commit is contained in:
Paul Gilbert 2017-12-29 19:41:59 -05:00
parent 4e11d05f76
commit 1bc519aadc
2 changed files with 8 additions and 8 deletions

View File

@ -574,7 +574,7 @@ void Party::giveTreasure() {
Windows &windows = *_vm->_windows;
Window &w = windows[10];
if (!_treasure._gold && !_treasure._gems)
if (!_treasure._hasItems && !_treasure._gold && !_treasure._gems)
return;
bool monstersPresent = false;
@ -652,7 +652,7 @@ void Party::giveTreasure() {
Character &c = _activeParty[charIndex];
if (!c._items[(ItemCategory)categoryNum].isFull() && !c.isDisabledOrDead()) {
giveTreasureToCharacter(c, (ItemCategory)categoryNum, itemNum);
continue;
break;
}
}
}
@ -1100,7 +1100,10 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
break;
case 21: {
int idx;
if (giveVal < 35) {
if (giveVal >= 82) {
_questItems[giveVal - 82]++;
}
if (giveVal < 35 || giveVal >= 82) {
for (idx = 0; idx < 10 && _treasure._weapons[idx]._id; ++idx);
if (idx < 10) {
_treasure._weapons[idx]._id = giveVal;
@ -1121,16 +1124,13 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
_treasure._hasItems = true;
return false;
}
} else if (giveVal < 82) {
} else {
for (idx = 0; idx < 10 && _treasure._misc[idx]._material; ++idx);
if (idx < 10) {
_treasure._accessories[idx]._material = giveVal - 60;
_treasure._hasItems = true;
return false;
}
} else {
_questItems[giveVal - 82]++;
return false;
}
return true;
}

View File

@ -1581,7 +1581,7 @@ const char *const Resources::BACKPACKS_FULL_PRESS_KEY =
"\v007\f12Warning! BackPacks Full!\fd\n"
"Press a Key";
const char *const Resources::HIT_A_KEY = "\x3l\v120\t000\x4""077\x3""c\f37Hit a key\f'd";
const char *const Resources::HIT_A_KEY = "\x3l\v120\t000\x4""077\x3""c\f37Hit a key\xC""d";
const char *const Resources::GIVE_TREASURE_FORMATTING =
"\x3l\v060\t000\x4""077\n"