mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-15 06:08:35 +00:00
DIRECTOR: Fix implementation of converting references to strings
This commit is contained in:
parent
8895ca3c1f
commit
8e6304bd13
@ -615,7 +615,21 @@ Common::String *Datum::toString() {
|
||||
*s = Common::String::format("var: #%s", u.sym->name.c_str());
|
||||
break;
|
||||
case REFERENCE:
|
||||
*s = Common::String::format("field#%d", u.i);
|
||||
{
|
||||
int idx = u.i;
|
||||
|
||||
if (!g_director->getCurrentScore()->_loadedText->contains(idx)) {
|
||||
if (!g_director->getCurrentScore()->_loadedText->contains(idx - 1024)) {
|
||||
warning("toString(): Unknown REFERENCE %d", idx);
|
||||
*s = "";
|
||||
break;
|
||||
} else {
|
||||
idx -= 1024;
|
||||
}
|
||||
}
|
||||
|
||||
*s = g_director->getCurrentScore()->_loadedText->getVal(idx)->_ptext;
|
||||
}
|
||||
break;
|
||||
default:
|
||||
warning("Incorrect operation toString() for type: %s", type2str());
|
||||
|
Loading…
Reference in New Issue
Block a user