fix dufflebag problem

svn-id: r11208
This commit is contained in:
Gregory Montoir 2003-11-08 16:36:54 +00:00
parent 688c80b062
commit 31b5146528
2 changed files with 12 additions and 7 deletions

View File

@ -1216,6 +1216,8 @@ int16 Command::setConditions(uint16 command, bool lastCmd) {
if (cmdGs->id == command) {
if (cmdGs->gameStateSlot > 0) {
if (_logic->gameState(cmdGs->gameStateSlot) != cmdGs->gameStateValue) {
debug(0, "Command::setConditions() - Failed test %X", ret);
debug(0, "Command::setConditions() - GS[%d] == %d (should be %d)", cmdGs->gameStateSlot, _logic->gameState(cmdGs->gameStateSlot), cmdGs->gameStateValue);
// failed test
ret = i;
break;
@ -1229,7 +1231,6 @@ int16 Command::setConditions(uint16 command, bool lastCmd) {
}
if (ret > 0) {
debug(0, "Command::setConditions() - Failed test %X", ret);
// we've failed, so see if we need to make Joe speak
cmdGs = &_cmdGameState[ret];
if (cmdGs->speakValue > 0 && lastCmd) {

View File

@ -679,8 +679,10 @@ int16 Logic::gameState(int index) {
}
void Logic::gameState(int index, int16 newValue) {
if (index >= 0 && index < GAME_STATE_COUNT)
_gameState[index] = newValue;
if (index >= 0 && index < GAME_STATE_COUNT) {
debug(0, "Logic::gameState() - GAMESTATE[%d] = %d", index, newValue);
_gameState[index] = newValue;
}
else
error("[QueenLogic::gameState] invalid index: %i", index);
}
@ -847,6 +849,8 @@ void Logic::roomErase() {
void Logic::roomSetupFurniture() {
int16 gstate[9];
_numFurnitureStatic = 0;
_numFurnitureAnimated = 0;
_numFurnitureAnimatedLen = 0;
@ -858,7 +862,7 @@ void Logic::roomSetupFurniture() {
for (i = 1; i <= _numFurniture; ++i) {
if (_furnitureData[i].room == _currentRoom) {
++furnitureTotal;
_gameState[furnitureTotal] = _furnitureData[i].gameStateValue;
gstate[furnitureTotal] = _furnitureData[i].gameStateValue;
}
}
if (furnitureTotal == 0) {
@ -873,7 +877,7 @@ void Logic::roomSetupFurniture() {
// unpack the static bobs
for (i = 1; i <= furnitureTotal; ++i) {
int16 obj = _gameState[i];
int16 obj = gstate[i];
if (obj > 0 && obj <= 5000) {
GraphicData *pgd = &_graphicData[obj];
if (pgd->lastFrame == 0) {
@ -893,7 +897,7 @@ void Logic::roomSetupFurniture() {
// unpack the animated bobs
uint16 curBob = 0;
for (i = 1; i <= furnitureTotal; ++i) {
int16 obj = _gameState[i];
int16 obj = gstate[i];
if (obj > 0 && obj <= 5000) {
GraphicData *pgd = &_graphicData[obj];
@ -926,7 +930,7 @@ void Logic::roomSetupFurniture() {
// unpack the paste downs
++curImage;
for (i = 1; i <= furnitureTotal; ++i) {
int16 obj = _gameState[i];
int16 obj = gstate[i];
if (obj > 5000) {
obj -= 5000;
GraphicData *pgd = &_graphicData[obj];