From cd970d594286c2d588e4594d1efa0365c00587da Mon Sep 17 00:00:00 2001 From: Misty De Meo Date: Wed, 5 Jul 2023 14:32:21 -0700 Subject: [PATCH] DIRECTOR: fix FileIO::m_fileName Adding one to the prefix's length meant the first character of the filename would be omitted. Fixes Ganbare Inuchan 2 creating savegames with the first letter the player typed missing. --- engines/director/lingo/xlibs/fileio.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engines/director/lingo/xlibs/fileio.cpp b/engines/director/lingo/xlibs/fileio.cpp index 51bf435642d..928efc5e3ef 100644 --- a/engines/director/lingo/xlibs/fileio.cpp +++ b/engines/director/lingo/xlibs/fileio.cpp @@ -494,7 +494,7 @@ void FileIO::m_fileName(int nargs) { Common::String prefix = g_director->getTargetName() + '-'; Common::String res = *me->_filename; if (res.hasPrefix(prefix)) { - res = Common::String(&me->_filename->c_str()[prefix.size() + 1]); + res = Common::String(&me->_filename->c_str()[prefix.size()]); } g_lingo->push(Datum(res));