PEGASUS: Add sanity check on the NItm resource being present

This commit is contained in:
Matthew Hoops 2013-04-15 18:32:00 -04:00
parent 582e464360
commit 749cdd6f44

View File

@ -239,6 +239,9 @@ bool PegasusEngine::detectOpeningClosingDirectory() {
void PegasusEngine::createItems() {
Common::SeekableReadStream *res = _resFork->getResource(MKTAG('N', 'I', 't', 'm'), 0x80);
if (!res)
error("Couldn't find neighborhood items resource");
uint16 entryCount = res->readUint16BE();
for (uint16 i = 0; i < entryCount; i++) {