XEEN: Swords changes for game flags array

This commit is contained in:
Paul Gilbert
2018-04-21 07:26:52 -04:00
parent ea524fa792
commit 0aeecb6c33
4 changed files with 8 additions and 6 deletions
+1 -1
View File
@@ -157,7 +157,7 @@ void Quests::execute() {
break;
case AUTO_NOTES: {
int count = _vm->getGameID() == GType_Swords ? 49 : MAX_DIALOG_LINES;
count = _vm->getGameID() == GType_Swords ? 49 : MAX_DIALOG_LINES;
for (int idx = 0; idx < count; ++idx)
lines[idx] = "";
+1 -1
View File
@@ -654,7 +654,7 @@ void Interface::doStepCode() {
break;
}
if (_vm->_files->_ccNum && party._gameFlags[1][118]) {
if (_vm->getGameID() != GType_Swords && _vm->_files->_ccNum && party._gameFlags[1][118]) {
_falling = FALL_NONE;
} else {
if (_falling != FALL_NONE)
+4 -2
View File
@@ -922,7 +922,8 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
break;
}
case 20:
_gameFlags[files._ccNum][takeVal] = false;
assert(takeVal < 256);
_gameFlags[_vm->getGameID() == GType_Swords ? 0 : files._ccNum][takeVal] = false;
break;
case 21: {
const uint WEAPONS_END = _vm->getGameID() != GType_Swords ? 35 : 41;
@@ -1187,7 +1188,8 @@ bool Party::giveTake(int takeMode, uint takeVal, int giveMode, uint giveVal, int
break;
}
case 20:
_gameFlags[files._ccNum][giveVal] = true;
assert(giveVal < 256);
_gameFlags[_vm->getGameID() == GType_Swords ? 0 : files._ccNum][giveVal] = true;
break;
case 21: {
const uint WEAPONS_END = _vm->getGameID() != GType_Swords ? 35 : 41;
+2 -2
View File
@@ -1589,9 +1589,9 @@ bool Scripts::ifProc(int action, uint32 val, int mode, int charIndex) {
break;
}
case 20:
if (files._ccNum)
assert(val < 256);
if (files._ccNum && _vm->getGameID() != GType_Swords)
val += 256;
assert(val < 512);
v = party._gameFlags[val / 256][val % 256] ? val : 0xffffffff;
break;
case 21: {