DIRECTOR: fix FileIO::m_fileName
Some checks failed
CI / Windows (push) Has been cancelled
CI / Xcode (push) Has been cancelled
CI / Ubuntu (push) Has been cancelled

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.
This commit is contained in:
Misty De Meo 2023-07-05 14:32:21 -07:00
parent b2948060cf
commit cd970d5942
No known key found for this signature in database
GPG key ID: 76CF846A2F674B2C

View file

@ -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));