TWINE: fixed dumpfile command

This commit is contained in:
Martin Gerhardy 2021-02-28 22:19:57 +01:00
parent ef8825f810
commit f8b16991c9
2 changed files with 3 additions and 3 deletions

View File

@ -328,8 +328,8 @@ bool TwinEConsole::doDumpFile(int argc, const char **argv) {
debugPrintf("Expected to get a a hqr file and an index\n");
return true;
}
const char *hqr = argv[0];
const int index = atoi(argv[1]);
const char *hqr = argv[1];
const int index = atoi(argv[2]);
const Common::String &targetFileName = Common::String::format("dumps/%03i-%s.dump", index, hqr);
HQR::dumpEntry(hqr, index, targetFileName.c_str());
return true;

View File

@ -266,7 +266,7 @@ int32 getAllocEntry(uint8 **ptr, const char *filename, int32 index) {
bool dumpEntry(const char *filename, int32 index, const char *targetFileName) {
Common::DumpFile out;
if (!out.open(targetFileName)) {
if (!out.open(targetFileName, true)) {
warning("Failed to save to %s", targetFileName);
return false;
}