Don't show warnings for a known script bug in SQ4CD with the Sq4GlobalNarrator object

svn-id: r49950
This commit is contained in:
Filippos Karapetis 2010-06-17 20:52:53 +00:00
parent c8dfa255a3
commit 701d69d6e2

View File

@ -406,19 +406,24 @@ ExecStack *send_selector(EngineState *s, reg_t send_obj, reg_t work_obj, StackPt
}
if (argc > 1) {
// argc can indeed be bigger than 1 in some cases, and it seems correct
// (i.e. we should skip that many bytes later on)... question is, why
// does this occur? Could such calls be used to point to data after X
// bytes in the heap? What are the skipped bytes in this case?
// In SQ4CD, this occurs with the returnVal selector of object
// Sq4GlobalNarrator when the game starts, and right after the narrator
// is heard (e.g. after he talks when examining something)
reg_t oldReg = *varp.getPointer(s->_segMan);
reg_t newReg = argp[1];
warning("send_selector(): argc = %d while modifying variable selector "
"%x (%s) of object %04x:%04x (%s) from %04x:%04x to %04x:%04x",
argc, selector, g_sci->getKernel()->getSelectorName(selector).c_str(), PRINT_REG(send_obj),
s->_segMan->getObjectName(send_obj), PRINT_REG(oldReg), PRINT_REG(newReg));
// argc can indeed be bigger than 1 in some cases, and it's usually the
// result of a script bug
const char *objectName = s->_segMan->getObjectName(send_obj);
if (!strcmp(objectName, "Sq4GlobalNarrator") && selector == 606) {
// SQ4 has a script bug in the Sq4GlobalNarrator object when invoking the
// returnVal selector, which doesn't affect gameplay, thus don't diplay it
} else {
// Unknown script bug, show it
reg_t oldReg = *varp.getPointer(s->_segMan);
reg_t newReg = argp[1];
const char *selectorName = g_sci->getKernel()->getSelectorName(selector).c_str();
warning("send_selector(): argc = %d while modifying variable selector "
"%x (%s) of object %04x:%04x (%s) from %04x:%04x to %04x:%04x",
argc, selector, selectorName, PRINT_REG(send_obj),
objectName, PRINT_REG(oldReg), PRINT_REG(newReg));
}
}
{