DIRECTOR: LINGO: Implement referring cast members by their names

This commit is contained in:
Eugene Sandulenko 2020-01-24 23:58:42 +01:00
parent 86e4752da4
commit f1c3343772

View File

@ -701,6 +701,12 @@ Datum Lingo::getTheCast(Datum &id1, int field) {
if (id1.type == INT) {
id = id1.u.i;
} else if (id1.type == STRING) {
if (_vm->getCurrentScore()->_castsNames.contains(*id1.u.s)) {
id = _vm->getCurrentScore()->_castsNames[*id1.u.s];
} else {
warning("Lingo::getTheCast(): Unknown the cast \"%s\"", id1.u.s->c_str());
}
} else {
warning("Lingo::getTheCast(): Unknown the cast id type: %s", id1.type2str());
return d;