diff options
author | Eugene Sandulenko | 2016-07-12 20:58:05 +0200 |
---|---|---|
committer | Eugene Sandulenko | 2016-08-03 23:40:36 +0200 |
commit | 8b20d3d67bcec592999376ca0cb3d3dede4d6789 (patch) | |
tree | 8cc356681cbc4d8d8b5524f681b832330c22b672 /engines/director/lingo | |
parent | c6406042afc834ff3ecc10a2dddbbb199090869c (diff) | |
download | scummvm-rg350-8b20d3d67bcec592999376ca0cb3d3dede4d6789.tar.gz scummvm-rg350-8b20d3d67bcec592999376ca0cb3d3dede4d6789.tar.bz2 scummvm-rg350-8b20d3d67bcec592999376ca0cb3d3dede4d6789.zip |
DIRECTOR: Lingo: Distinguish same name the fields for different the entities
Diffstat (limited to 'engines/director/lingo')
-rw-r--r-- | engines/director/lingo/lingo-lex.cpp | 14 | ||||
-rw-r--r-- | engines/director/lingo/lingo-lex.l | 12 | ||||
-rw-r--r-- | engines/director/lingo/lingo-the.cpp | 2 |
3 files changed, 14 insertions, 14 deletions
diff --git a/engines/director/lingo/lingo-lex.cpp b/engines/director/lingo/lingo-lex.cpp index fabac3f287..b40ca07fcb 100644 --- a/engines/director/lingo/lingo-lex.cpp +++ b/engines/director/lingo/lingo-lex.cpp @@ -1088,10 +1088,6 @@ YY_RULE_SETUP while (*ptr != ' ' && *ptr != '\t') field += *ptr++; - if (!g_lingo->_theEntityFields.contains(field)) { - error("Unhandled the field %s", ptr); - } - while (*ptr == ' ' || *ptr == '\t') ptr++; @@ -1101,6 +1097,12 @@ YY_RULE_SETUP ptr++; if (g_lingo->_theEntities.contains(ptr)) { + field = Common::String::format("%d%s", g_lingo->_theEntities[ptr]->entity, field.c_str()); + + if (!g_lingo->_theEntityFields.contains(field)) { + error("Unhandled the field %s", ptr); + } + if (g_lingo->_theEntityFields[field]->entity != g_lingo->_theEntities[ptr]->entity) error("Unsupported field '%s' for entity '%s'", field.c_str(), ptr); @@ -1118,7 +1120,7 @@ YY_RULE_SETUP YY_BREAK case 32: YY_RULE_SETUP -#line 131 "engines/director/lingo/lingo-lex.l" +#line 133 "engines/director/lingo/lingo-lex.l" { count(); @@ -1134,8 +1136,6 @@ YY_RULE_SETUP return THEENTITYWITHID; else return THEENTITY; - } else if (g_lingo->_theEntityFields.contains(ptr)) { - error("the field without entity: %s", ptr); } error("Unhandled the entity %s", ptr); diff --git a/engines/director/lingo/lingo-lex.l b/engines/director/lingo/lingo-lex.l index 4739d20d86..9113ac39ee 100644 --- a/engines/director/lingo/lingo-lex.l +++ b/engines/director/lingo/lingo-lex.l @@ -101,10 +101,6 @@ whitespace [\t ] while (*ptr != ' ' && *ptr != '\t') field += *ptr++; - if (!g_lingo->_theEntityFields.contains(field)) { - error("Unhandled the field %s", ptr); - } - while (*ptr == ' ' || *ptr == '\t') ptr++; @@ -114,6 +110,12 @@ whitespace [\t ] ptr++; if (g_lingo->_theEntities.contains(ptr)) { + field = Common::String::format("%d%s", g_lingo->_theEntities[ptr]->entity, field.c_str()); + + if (!g_lingo->_theEntityFields.contains(field)) { + error("Unhandled the field %s", ptr); + } + if (g_lingo->_theEntityFields[field]->entity != g_lingo->_theEntities[ptr]->entity) error("Unsupported field '%s' for entity '%s'", field.c_str(), ptr); @@ -143,8 +145,6 @@ whitespace [\t ] return THEENTITYWITHID; else return THEENTITY; - } else if (g_lingo->_theEntityFields.contains(ptr)) { - error("the field without entity: %s", ptr); } error("Unhandled the entity %s", ptr); diff --git a/engines/director/lingo/lingo-the.cpp b/engines/director/lingo/lingo-the.cpp index 00af1dd6e8..b2e412f76f 100644 --- a/engines/director/lingo/lingo-the.cpp +++ b/engines/director/lingo/lingo-the.cpp @@ -168,7 +168,7 @@ void Lingo::initTheEntities() { TheEntityField *f = fields; while (f->entity != kTheNOEntity) { - _theEntityFields[f->name] = f; + _theEntityFields[Common::String::format("%d%s", f->entity, f->name)] = f; f++; } } |