DIRECTOR: fix where dumped scripts starts with '-'

Prepend dumped scripts with 'stream' when the script resources
weren't loaded via a file but a stream.
This commit is contained in:
Roland van Laar 2020-06-17 21:47:02 +02:00
parent f8fa6ec649
commit 90c1ee36f6

View file

@ -508,8 +508,13 @@ bool RIFXArchive::openStream(Common::SeekableReadStream *stream, uint32 startOff
data = (byte *)malloc(resources[i].size);
dataSize = resources[i].size;
}
Common::String prepend;
if (_fileName.size() != 0)
prepend = _fileName;
else
prepend = "stream";
Common::String filename = Common::String::format("./dumps/%s-%s-%d", _fileName.c_str(), tag2str(resources[i].tag), i);
Common::String filename = Common::String::format("./dumps/%s-%s-%d", prepend.c_str(), tag2str(resources[i].tag), i);
stream->read(data, len);
if (!out.open(filename)) {