aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPaul Gilbert2018-04-19 21:21:59 -0400
committerPaul Gilbert2018-04-19 21:21:59 -0400
commit8d577f491640d8c8589c4b73672c982a46d19089 (patch)
tree42312b697737be26118d047af8cc65fe696ed2d4
parentbd69f99f8b7ab27f6ca7df9a699fe800e8e5c6f8 (diff)
downloadscummvm-rg350-8d577f491640d8c8589c4b73672c982a46d19089.tar.gz
scummvm-rg350-8d577f491640d8c8589c4b73672c982a46d19089.tar.bz2
scummvm-rg350-8d577f491640d8c8589c4b73672c982a46d19089.zip
XEEN: Alter quest flag handling to accomodate Swords
-rw-r--r--engines/xeen/combat.cpp2
-rw-r--r--engines/xeen/dialogs/dialogs_quests.cpp2
-rw-r--r--engines/xeen/party.cpp10
-rw-r--r--engines/xeen/party.h2
-rw-r--r--engines/xeen/scripts.cpp2
5 files changed, 8 insertions, 10 deletions
diff --git a/engines/xeen/combat.cpp b/engines/xeen/combat.cpp
index f3baca77a4..0e1dc9a3a1 100644
--- a/engines/xeen/combat.cpp
+++ b/engines/xeen/combat.cpp
@@ -1474,7 +1474,7 @@ void Combat::attack2(int damage, RangeType rangeType) {
party._gameFlags[0][11] = true;
if (_monster2Attack == 8 && party._mazeId == 78) {
party._gameFlags[0][60] = true;
- party._questFlags[0][23] = false;
+ party._questFlags[23] = false;
for (uint idx = 0; idx < party._activeParty.size(); ++idx)
party._activeParty[idx].setAward(42, true);
diff --git a/engines/xeen/dialogs/dialogs_quests.cpp b/engines/xeen/dialogs/dialogs_quests.cpp
index 84c3cd11da..e0e9829fd9 100644
--- a/engines/xeen/dialogs/dialogs_quests.cpp
+++ b/engines/xeen/dialogs/dialogs_quests.cpp
@@ -136,7 +136,7 @@ void Quests::execute() {
count = 0;
headerShown = false;
for (int idx = 0; idx < TOTAL_QUEST_FLAGS; ++idx) {
- if (party._questFlags[(idx + 1) / 30][(idx + 1) % 30]) {
+ if (party._questFlags[idx + 1]) {
if (!count && !headerShown && (_vm->getGameID() == GType_Swords || idx < 29)) {
lines[count++] = title1;
}
diff --git a/engines/xeen/party.cpp b/engines/xeen/party.cpp
index 321c59b5b8..66d1313b82 100644
--- a/engines/xeen/party.cpp
+++ b/engines/xeen/party.cpp
@@ -245,8 +245,7 @@ Party::Party(XeenEngine *vm) {
Common::fill(&_gameFlags[0][0], &_gameFlags[0][256], false);
Common::fill(&_gameFlags[1][0], &_gameFlags[1][256], false);
Common::fill(&_worldFlags[0], &_worldFlags[128], false);
- Common::fill(&_questFlags[0][0], &_questFlags[0][30], false);
- Common::fill(&_questFlags[1][0], &_questFlags[1][30], false);
+ Common::fill(&_questFlags[0], &_questFlags[60], false);
Common::fill(&_questItems[0], &_questItems[85], 0);
for (int i = 0; i < TOTAL_CHARACTERS; ++i)
@@ -331,8 +330,7 @@ void Party::synchronize(Common::Serializer &s) {
File::syncBitFlags(s, &_gameFlags[0][0], &_gameFlags[0][256]);
File::syncBitFlags(s, &_gameFlags[1][0], &_gameFlags[1][256]);
File::syncBitFlags(s, &_worldFlags[0], &_worldFlags[128]);
- File::syncBitFlags(s, &_questFlags[0][0], &_questFlags[0][30]);
- File::syncBitFlags(s, &_questFlags[1][0], &_questFlags[1][30]);
+ File::syncBitFlags(s, &_questFlags[0], &_questFlags[60]);
for (int i = 0; i < 85; ++i)
s.syncAsByte(_questItems[i]);
@@ -1108,7 +1106,7 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
_worldFlags[takeVal] = false;
break;
case 104:
- _questFlags[files._ccNum][takeVal] = false;
+ _questFlags[(_vm->getGameID() == GType_Swords ? 0 : files._ccNum * 30) + takeVal] = false;
break;
case 107:
_characterFlags[ps._rosterId][takeVal] = false;
@@ -1442,7 +1440,7 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
break;
case 104:
assert(giveVal < 30);
- _questFlags[files._ccNum][giveVal] = true;
+ _questFlags[(_vm->getGameID() == GType_Swords ? 0 : files._ccNum * 30) + giveVal] = true;
break;
case 107:
assert(giveVal < 24);
diff --git a/engines/xeen/party.h b/engines/xeen/party.h
index 3d6142451c..fde6defeee 100644
--- a/engines/xeen/party.h
+++ b/engines/xeen/party.h
@@ -220,7 +220,7 @@ public:
bool _rested;
bool _gameFlags[2][256];
bool _worldFlags[128];
- bool _questFlags[2][30];
+ bool _questFlags[60];
int _questItems[TOTAL_QUEST_ITEMS];
bool _characterFlags[30][24];
public:
diff --git a/engines/xeen/scripts.cpp b/engines/xeen/scripts.cpp
index f126a658a2..8c1f4a0255 100644
--- a/engines/xeen/scripts.cpp
+++ b/engines/xeen/scripts.cpp
@@ -1834,7 +1834,7 @@ bool Scripts::ifProc(int action, uint32 val, int mode, int charIndex) {
break;
case 104:
// Get value of quest flag
- v = party._questFlags[files._ccNum][val] ? val : 0xffffffff;
+ v = party._questFlags[(_vm->getGameID() == GType_Swords ? 0 : files._ccNum * 30) + val] ? val : 0xffffffff;
break;
case 105:
// Test number of Megacredits in party. Only used by King's Engineer in Castle Burlock