HUGO: Fix 2 bugs that were causing several crashes using the mouse

svn-id: r55097
This commit is contained in:
Arnaud Boutonné 2011-01-02 21:32:56 +00:00
parent 83f0a28623
commit eeaeab93e8
2 changed files with 3 additions and 2 deletions

View File

@ -1173,7 +1173,7 @@ char *HugoEngine::useBG(char *name) {
debugC(1, kDebugEngine, "useBG(%s)", name);
objectList_t p = _backgroundObjects[*_screen_p];
for (int i = 0; *_arrayVerbs[p[i].verbIndex]; i++) {
for (int i = 0; p[i].verbIndex != 0; i++) {
if ((name == _arrayNouns[p[i].nounIndex][0] &&
p[i].verbIndex != _look) &&
((p[i].roomState == DONT_CARE) || (p[i].roomState == _screenStates[*_screen_p])))

View File

@ -118,7 +118,8 @@ void ObjectHandler::useObject(int16 objId) {
if (_vm->getGameStatus().inventoryObjId == use->objId) {
// Look for secondary object, if found use matching verb
bool foundFl = false;
for (target_t *target = use->targets; _vm->_arrayNouns[target->nounIndex] != 0; target++)
for (target_t *target = use->targets; target->nounIndex != 0; target++)
if (target->nounIndex == obj->nounIndex) {
foundFl = true;
sprintf(_line, "%s %s %s", _vm->_arrayVerbs[target->verbIndex][0],